예제 #1
0
 private void AddPlugin(string FileName)
 {
     Assembly assembly = Assembly.LoadFrom(FileName);
     foreach (Type type in assembly.GetTypes())
     {
         if (type.IsPublic && !type.IsAbstract)
         {
             if (this.GetPluginInterface(type) != null)
             {
                 AvailablePlugin pluginToAdd = new AvailablePlugin
                 {
                     AssemblyPath = FileName,
                     Instance = (IBasePlugin)Activator.CreateInstance(assembly.GetType(type.ToString()))
                 };
                 pluginToAdd.Instance.Initialize();
                 this.availablePlugins.Add(pluginToAdd);
                 pluginToAdd = null;
             }
         }
     }
     assembly = null;
 }
        private void AddPlugin(string FileName)
        {
            Assembly assembly = Assembly.LoadFrom(FileName);

            foreach (Type type in assembly.GetTypes())
            {
                if (type.IsPublic && !type.IsAbstract)
                {
                    if (this.GetPluginInterface(type) != null)
                    {
                        AvailablePlugin pluginToAdd = new AvailablePlugin
                        {
                            AssemblyPath = FileName,
                            Instance     = (IBasePlugin)Activator.CreateInstance(assembly.GetType(type.ToString()))
                        };
                        pluginToAdd.Instance.Initialize();
                        this.availablePlugins.Add(pluginToAdd);
                        pluginToAdd = null;
                    }
                }
            }
            assembly = null;
        }
예제 #3
0
 public void Remove(AvailablePlugin pluginToRemove)
 {
     base.List.Remove(pluginToRemove);
 }
예제 #4
0
 public void Add(AvailablePlugin pluginToAdd)
 {
     base.List.Add(pluginToAdd);
 }
예제 #5
0
 public void Remove(AvailablePlugin pluginToRemove)
 {
     base.List.Remove(pluginToRemove);
 }
예제 #6
0
 public void Add(AvailablePlugin pluginToAdd)
 {
     base.List.Add(pluginToAdd);
 }