Ejemplo n.º 1
0
        private static void InitPlugin(IPlugin plugin)
        {
            if (!plugin.Verify)
            {
                System.Windows.Forms.MessageBox.Show($"{plugin.PluginInfo.Name} verifycation failed. Please reinstall/update this plugin.");
                return;
            }
            if (plugin is ILBPlugin)
            {
                ILBPlugin lbplugin = plugin as ILBPlugin;

                HandlerLBStart += lbplugin.OnLBStart;
                HandlerLBClose += lbplugin.OnLBClose;

                HandlerClientStatusChanged += lbplugin.OnClientStatusChanged;
                lbplugin.Accounts           = AccountManager.IAccs;
                lbplugin.Environment        = new EnvironmentInfo
                {
                    LB_PluginsPath    = EnviromentManager.LBPluginsPath,
                    GwClient_Version  = EnviromentManager.GwClientVersion,
                    GwClient_UpToDate = EnviromentManager.GwClientUpToDate ?? false,
                    LB_LocaldatsPath  = EnviromentManager.LBLocaldatsPath
                };
                lbplugin.Init();

                if (lbplugin.UIContent != null)
                {
                    EnviromentManager.MainWin.AddTabPlugin(lbplugin.UIContent);
                }
            }
        }
Ejemplo n.º 2
0
        private static void InitPlugin(IPlugin plugin)
        {
            if (!plugin.Verify)
            {
                System.Windows.Forms.MessageBox.Show($"{plugin.PluginInfo.Name} verifycation failed. Please reinstall/update this plugin.");
                return;
            }

            if (!plugin.Init())
            {
                System.Windows.Forms.MessageBox.Show($"Could not initialize plugin {plugin.PluginInfo.Name}");
                return;
            }

            if (plugin is ILBPlugin)
            {
                ILBPlugin lbplugin = plugin as ILBPlugin;

                HandlerLBStart += lbplugin.OnLBStart;
                HandlerLBClose += lbplugin.OnLBClose;

                HandlerClientStatusChanged += lbplugin.OnClientStatusChanged;
                lbplugin.Accounts           = AccountManager.IAccs;
                lbplugin.Init();

                if (lbplugin.UIContent != null)
                {
                    EnviromentManager.MainWin.AddTabPlugin(lbplugin);
                }
            }
        }