예제 #1
0
        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);
        }
예제 #2
0
 public PluginDataItem(Views.Plugins.PluginBase plugin)
 {
     TypeName     = plugin.GetType().ToString();
     Outputs      = plugin.Outputs;
     Inputs       = plugin.Inputs;
     InstanceName = plugin.InstanceName;
 }