Exemplo n.º 1
0
 /// <summary>
 /// Attempts to import an assembly as a node library from a given file path.
 /// </summary>
 /// <param name="model"></param>
 /// <param name="path"></param>
 protected static void ImportAssembly(DynamoModel model, string path)
 {
     try
     {
         var filePath = new System.IO.FileInfo(path);
         if (!filePath.Exists)
         {
             Console.WriteLine($"could not find requested import library at path{path}");
         }
         else
         {
             Console.WriteLine($"attempting to import assembly {path}");
             var assembly = System.Reflection.Assembly.LoadFile(path);
             model.LoadNodeLibrary(assembly, true);
         }
     }
     catch (Exception e)
     {
         Console.WriteLine($"exception while trying to load assembly {path}: {e}");
     }
 }
Exemplo n.º 2
0
 public void LoadNodeLibrary(Assembly library)
 {
     model.LoadNodeLibrary(library);
 }