コード例 #1
0
        private void RegisterPlugin(FileInfo assemblyFileInfo)
        {
            PhactoryHost.Plugin plugin = null;

            System.Reflection.Assembly assembly;
            try
            {
                assembly = System.Reflection.Assembly.LoadFrom(assemblyFileInfo.FullName);
            }
            catch
            {
                return;
            }

            foreach (Type type in assembly.GetTypes())
            {
                if (type.IsClass && (type.GetInterface("PhactoryHost.Plugin") != null))
                {
                    plugin = Activator.CreateInstance(type) as PhactoryHost.Plugin;

                    if (App.Controller.UserConfig.VerboseOutput)
                    {
                        LogPluginInfo(plugin);
                    }

                    plugins.Add(plugin);
                    plugin.Register(host);
                }
            }
        }
コード例 #2
0
        private void RegisterPlugins()
        {
            PhactoryHost.Plugin plugin = null;

            foreach (Type type in Assembly.GetExecutingAssembly().GetTypes())
            {
                if (type.IsClass && (type.GetInterface("PhactoryHost.Plugin") != null))
                {
                    plugin = Activator.CreateInstance(type) as PhactoryHost.Plugin;

                    if (App.Controller.UserConfig.VerboseOutput)
                    {
                        LogPluginInfo(plugin);
                    }

                    plugins.Add(plugin);
                    plugin.Register(host);
                }
            }
        }