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; }
public void Remove(AvailablePlugin pluginToRemove) { base.List.Remove(pluginToRemove); }
public void Add(AvailablePlugin pluginToAdd) { base.List.Add(pluginToAdd); }