public Views.Plugins.PluginBase GetPlugin() { var ListOfPluginTypes = (from lAssembly in AppDomain.CurrentDomain.GetAssemblies() from lType in lAssembly.GetTypes() where typeof(Views.Plugins.PluginBase).IsAssignableFrom(lType) select lType).ToArray(); Views.Plugins.PluginBase pluginToAdd = null; foreach (Type pluginType in ListOfPluginTypes) { if (pluginType.ToString() == TypeName) { pluginToAdd = (Views.Plugins.PluginBase)Activator.CreateInstance(pluginType); } } if (pluginToAdd != null) { pluginToAdd.Inputs = Inputs; foreach (var vm in pluginToAdd.Inputs.Values) { vm.PostLoadSetup(); } pluginToAdd.Outputs = Outputs; pluginToAdd.PluginData = PluginData; pluginToAdd.InstanceName = InstanceName; } return(pluginToAdd); }
public PluginDataItem(Views.Plugins.PluginBase plugin) { TypeName = plugin.GetType().ToString(); Outputs = plugin.Outputs; Inputs = plugin.Inputs; InstanceName = plugin.InstanceName; }