本文整理汇总了C#中LibraryServices.ImportLibrary方法的典型用法代码示例。如果您正苦于以下问题:C# LibraryServices.ImportLibrary方法的具体用法?C# LibraryServices.ImportLibrary怎么用?C# LibraryServices.ImportLibrary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibraryServices
的用法示例。
在下文中一共展示了LibraryServices.ImportLibrary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadAssembliesIntoDynamo
private void LoadAssembliesIntoDynamo( DynamoLoader loader, ILogger logger, LibraryServices libraryServices)
{
var assemblies = LoadAssembliesInBinDirectory(logger);
// filter the assemblies
var zeroTouchAssemblies = new List<Assembly>();
var nodeModelAssemblies = new List<Assembly>();
foreach (var assem in assemblies)
{
if (loader.ContainsNodeModelSubType(assem))
{
nodeModelAssemblies.Add(assem);
}
else
{
zeroTouchAssemblies.Add(assem);
}
}
// load the zero touch assemblies
foreach (var zeroTouchAssem in zeroTouchAssemblies)
{
libraryServices.ImportLibrary(zeroTouchAssem.Location, logger);
}
// load the node model assemblies
foreach (var nodeModelAssem in nodeModelAssemblies)
{
var nodes = loader.LoadNodesFromAssembly(nodeModelAssem);
nodes.ForEach(x => LoadedTypes.Add(x));
}
}