Пример #1
0
        private void BuildIndex(XmlDocument catalog, XmlNode mapNode)
        {
            if (!Directory.Exists(this.PluginLocalPath))
            {
                return;
            }
            string[] files    = Directory.GetFiles(this.PluginLocalPath, "*.dll", SearchOption.AllDirectories);
            string   fullName = typeof(IPlugin).FullName;

            string[] array = files;
            for (int i = 0; i < array.Length; i++)
            {
                string   filename      = array[i];
                Assembly assembly      = Assembly.Load(PluginContainer.LoadPlugin(filename));
                Type[]   exportedTypes = assembly.GetExportedTypes();
                for (int j = 0; j < exportedTypes.Length; j++)
                {
                    Type type_ = exportedTypes[j];
                    if (PluginContainer.CheckIsPlugin(type_, fullName))
                    {
                        this.AddPlugin(type_, filename, catalog, mapNode);
                    }
                }
            }
        }
Пример #2
0
 private void BuildIndex(XmlDocument catalog, XmlNode mapNode)
 {
     if (Directory.Exists(this.PluginLocalPath))
     {
         string[] files    = Directory.GetFiles(this.PluginLocalPath, "*.dll", SearchOption.AllDirectories);
         string   fullName = typeof(IPlugin).FullName;
         string[] array    = files;
         foreach (string filename in array)
         {
             Assembly assembly      = Assembly.Load(PluginContainer.LoadPlugin(filename));
             Type[]   exportedTypes = assembly.GetExportedTypes();
             foreach (Type t in exportedTypes)
             {
                 if (PluginContainer.CheckIsPlugin(t, fullName))
                 {
                     this.AddPlugin(t, filename, catalog, mapNode);
                 }
             }
         }
     }
 }