Пример #1
0
 public override void Init(Kernel kernel)
 {
     PluginOptions = new PluginConfiguration<PluginOptions>(kernel, this.GetType().Assembly);
     PluginOptions.Load();
 }
Пример #2
0
 public void Init(Kernel config)
 {
     pluginInterface.Init(config);
 }
Пример #3
0
        static Kernel GetDefaultKernel(ConfigData config)
        {
            var kernel = new Kernel()
            {
                Plugins = DefaultPlugins(),
                StringData = new LocalizedStrings(),
                ConfigData = config
            };
            foreach (var plugin in kernel.Plugins.ToList())
            {
                try
                {
                    plugin.Init(kernel);
                }
                catch
                {
                    kernel.Plugins.Remove(plugin);
                }
            }

            kernel.Plugins.Sort(delegate(IPlugin p1, IPlugin p2) { return p1.Options.Order.CompareTo(p2.Options.Order); });
            int index = 0;
            foreach (var plugin in kernel.Plugins.ToList())
            {
                if (plugin.Options.Order != index)
                {
                    plugin.Options.Order = index;
                    plugin.Save();
                }
                index++;
            }
            kernel.ItemCollection = new ItemCollection(config.RootFolders);
            kernel.Message = new GenerateMessage();

            return kernel;
        }
Пример #4
0
 public static void ReloadKernel()
 {
     kernel = null;
     Init();
 }
Пример #5
0
 public abstract void Init(Kernel kernel);
Пример #6
0
 public void Init(Kernel kernel)
 {
 }