Ejemplo n.º 1
0
 private static void BuildIndex(string pluginPath, DataTable dtExporters, DataTable dtImporters)
 {
     if (Directory.Exists(pluginPath))
     {
         string[] files = Directory.GetFiles(pluginPath, "*.dll", SearchOption.AllDirectories);
         string[] array = files;
         foreach (string filename in array)
         {
             Assembly assembly      = Assembly.Load(TransferContainer.LoadPluginFile(filename));
             Type[]   exportedTypes = assembly.GetExportedTypes();
             foreach (Type type in exportedTypes)
             {
                 if (type.BaseType != null)
                 {
                     if (type.BaseType.Name == "ExportAdapter")
                     {
                         TransferContainer.AddToExportIndex(type, filename, dtExporters);
                     }
                     else if (type.BaseType.Name == "ImportAdapter")
                     {
                         TransferContainer.AddToImportIndex(type, filename, dtImporters);
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 private static void BuildIndex(string pluginPath, DataTable dtExporters, DataTable dtImporters)
 {
     if (!Directory.Exists(pluginPath))
     {
         return;
     }
     string[] files = Directory.GetFiles(pluginPath, "*.dll", SearchOption.AllDirectories);
     string[] array = files;
     for (int i = 0; i < array.Length; i++)
     {
         string   filename      = array[i];
         Assembly assembly      = Assembly.Load(TransferContainer.LoadPluginFile(filename));
         Type[]   exportedTypes = assembly.GetExportedTypes();
         for (int j = 0; j < exportedTypes.Length; j++)
         {
             Type type = exportedTypes[j];
             if (type.BaseType != null)
             {
                 if (type.BaseType.Name == "ExportAdapter")
                 {
                     TransferContainer.AddToExportIndex(type, filename, dtExporters);
                 }
                 else if (type.BaseType.Name == "ImportAdapter")
                 {
                     TransferContainer.AddToImportIndex(type, filename, dtImporters);
                 }
             }
         }
     }
 }