ImportLibraryItem(destinationNode, nodeClass, libaryName, itemPath, conflictResolutionChoices, preserveTypeDependencyPaths)

将模板导入到项目中。
static IUANode ImportLibraryItem(IUANode destinationNode, NodeClass nodeClass, string libraryName, string itemPath, List<TypeConflictResolutionChoice> conflictResolutionChoices, bool preserveTypeDependencyPaths);

参数

destinationNode
(IUANode)
要向其中导入模板的项目节点的路径。
nodeClass
(NodeClass)
与节点对应的 C# 类。
libaryName
(string)
要从中导入模板的库的名称。
itemPath
(string)
模板的路径。该路径可以包含模板的浏览名称或显示名称。
conflictResolutionChoices
(null | List<TypeConflictResolutionChoice>)
可选的自定义冲突解决方案选项。有关如何定义自定义冲突解决方案选项的详细信息,请参见TypeConflictResolutionChoice(browseName, nodeClass, resolution)
preserveTypeDependencyPaths
(bool)
默认情况下,如果导入具有依赖项的模板,则会在所导入模板的父节点中显示对象。保留库元素的路径允许您将模板依赖项导入其原始节点中。
例如,启用
保留库元素的路径
后,如果导入的小组件取决于
模型
文件夹中的对象,则将在
模型
文件夹中显示对象。

示例

namespace UAManagedCore { public static class TemplateLibrary { public static IUANode ImportLibraryItem(IUANode destinationNode, NodeClass nodeClass, string libraryName, string itemPath, List<TypeConflictResolutionChoice> conflictResolutionChoices = null, bool preserveTypeDependencyPaths = false); } }
提供反馈
对本文档有问题或反馈吗? 请在这里提交您的反馈