Пример #1
0
        /// <summary>
        /// Produces Exchange Rate Result Among Available Output Types
        /// </summary>
        /// <param name="username">User name for authentication</param>
        /// <param name="password">Pasword for authentication</param>
        public ExchangeRateAPI(string username, string password)
        {
            _username = username;
            _password = password;

            Log.Logger.Instance.Info($"UserName:{_username} created an instance of ExchangeRateAPI");

            Task.Run(() => CheckAuthentication()).Wait();

            if (Authentication.AuthService.IsAuthenticated == false)
            {
                Log.Logger.Instance.Error(new System.Security.Authentication.AuthenticationException($"UserName:{_username} You must authenticate yourself"));
                throw new System.Security.Authentication.AuthenticationException("You must authenticate yourself!");
            }

            string      CultureName = Thread.CurrentThread.CurrentCulture.Name;
            CultureInfo ci          = new CultureInfo(CultureName);

            if (ci.NumberFormat.NumberDecimalSeparator != ".")
            {
                ci.NumberFormat.NumberDecimalSeparator = ".";
                Thread.CurrentThread.CurrentCulture    = ci;
            }

            _plugins = new Dictionary <string, PluginContracts.IPlugin>();

            ICollection <PluginContracts.IPlugin> plugins = GenericPluginLoader <PluginContracts.IPlugin> .LoadPlugins(@"Plugins");

            foreach (var item in plugins)
            {
                _plugins.Add(item.Name, item);
            }

            Log.Logger.Instance.Info($"UserName:{_username} - There are {_plugins.Count.ToString()} plugins found. {string.Join("|", _plugins.Select(p => p.Key))}");
        }
Пример #2
0
        public MainForm()
        {
            InitializeComponent();

            ShaderTools.executableDir = executableDir;

            Config.StartupFromFile(MainForm.executableDir + "\\config.xml");
            dockContent = new DockContentST();
            dockContent = Viewport.Instance;

            GenericPluginLoader.LoadPlugin();

            foreach (var plugin in GenericPluginLoader._Plugins)
            {
                plugin.Value.MainForm     = this;
                plugin.Value.DockedEditor = dockContent;
                plugin.Value.Load();
                LoadPluginContextMenus(plugin.Value.Types);
            }
            Settings settings = new Settings(this);

            settings.Close();
            Reload();
            LoadPluginFileContextMenus();
        }
Пример #3
0
        public MainForm()
        {
            if (DebugProgram)
            {
                System.AppDomain.CurrentDomain.UnhandledException += ExceptionHandler;
            }

            InitializeComponent();
            UpdateToolbar();

            ShaderTools.executableDir = executableDir;

            try
            {
                Config.StartupFromFile(executableDir + "\\config.xml");
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Failed to load config file! {ex}");
            }

            GenericPluginLoader.LoadPlugin();
            foreach (var plugin in GenericPluginLoader._Plugins)
            {
                plugin.Value.Load();
                LoadPluginContextMenus(plugin.Value.Types);
            }
            Settings settings = new Settings(this);

            settings.Close();
            Reload();
            LoadPluginFileContextMenus();
        }
Пример #4
0
        //static T AddObject<T>(EnvDTE.Expression exp)
        //    where T : Visual3D
        //{
        //    Logger.Log(exp, string.Format("Reading ReadEnumerableMesh. Name: {0}, val: {1}, type: {2}", exp.Name, exp.Value, exp.Type));

        //    string type = "";
        //    Add3DGenericObjectDelegate obj3d = dictType2[type];

        //    MetaObject<T> obj = obj3d(exp) as MetaObject<T>;

        //    T v3d = obj.To3DObject();

        //    obj.VisualizationProperties(v3d);

        //    return v3d;
        //}
        //static ModelVisual3D AddEnumerableObject<T>(EnvDTE.Expression exp)
        //    where T : Visual3D
        //{
        //    Logger.Log(exp, string.Format("Reading ReadEnumerableMesh. Name: {0}, val: {1}, type: {2}", exp.Name, exp.Value, exp.Type));

        //    ModelVisual3D objs = new ModelVisual3D();

        //    foreach (EnvDTE.Expression exp1 in ReaderUtils.ReadEnumerable(exp))
        //    {
        //        if (!exp1.IsValidValue)// LG 170515 .Value == "null"
        //            continue;

        //        T obj = AddObject<T>(exp1);

        //        objs.Children.Add(obj);
        //    }

        //    return objs;
        //}


        internal static void LoadDlls()
        {
            ICollection <MetaObject> objs = GenericPluginLoader <MetaObject> .LoadPlugins(@"C:\Users\" + Environment.UserName + @"\AppData\Local\Dodo\3D VSualizer");

            foreach (MetaObject obj in objs)
            {
                string name = obj.DebuggerTypeName;
                string type = obj.GetType().FullName;
                try
                {
                    dictType_.Add(name, obj);
                    Logger.Log("", "added to dict this type " + type + " linking to: " + name);
                }
                catch (Exception e)
                {
                    Logger.Log("", "dictionary already has this type " + type);
                }

                //_Add3DObject add = Add(obj);

                //Add3DObjectDelegate addDel = new Add3DObjectDelegate((e, hv, dict, b) => Add3D(e, hv, dict, b, add));
                //// add to type dict
                //dictType.Add(name, addDel);
            }
        }
Пример #5
0
 private void LoadPLugins()
 {
     GenericPluginLoader.LoadPlugin();
     foreach (var plugin in GenericPluginLoader._Plugins)
     {
         plugin.Value.Load();
         LoadPluginContextMenus(plugin.Value.Types);
     }
 }
Пример #6
0
        public static ICache Creator()
        {
            var pluginPath = ConfigurationManager.AppSettings["ParsCacheProviderPath"];
            var provider   = ConfigurationManager.AppSettings["ParsCacheProvider"];

            ICollection <ICache> plugins = GenericPluginLoader <ICache> .LoadPlugins(pluginPath);

            var plugin = plugins.FirstOrDefault(q => q.CacheProvider == provider);

            return(plugin);
        }
Пример #7
0
        private void bwDoWork(object sender, DoWorkEventArgs e)
        {
            plugins.Clear();

            DirectoryInfo pluginDirectory = new DirectoryInfo(pluginPath);

            if (!pluginDirectory.Exists)
            {
                pluginDirectory.Create();
            }

            pluginsCollection = GenericPluginLoader <IPlugin> .LoadPlugins(pluginPath);
        }
        /// <summary>
        /// Loads all plug-ins into the current AppDomain
        /// </summary>
        /// <returns>A collection of plug-ins that were loaded</returns>
        /// <exception cref="PathTooLongException"></exception>
        public virtual IEnumerable <Assembly> LoadPluginAssemblies()
        {
            var path = GetPluginPath();

            if (Directory.Exists(path))
            {
                var loader     = new GenericPluginLoader <IPlugin>();
                var assemblies = loader.LoadAssemblies(path);

                return(assemblies);
            }
            else
            {
                return(new List <Assembly>());
            }
        }
Пример #9
0
        public static void loadType()
        {
            ICollection <T> _sportExtensionInformation = GenericPluginLoader <T> .LoadPlugins("Plugins");

            // Did we get any results?
            if (_sportExtensionInformation != null)
            {
                foreach (T _isei in _sportExtensionInformation)
                {
                    if (!_plugins.ContainsKey(_isei.Sport))
                    {
                        _plugins.Add(_isei.Sport, _isei);
                    }
                }
            }
        }
        private void LoadPlugins()
        {
            string[] dllFileNames = null;
            if (Directory.Exists(PluginDirectory))
            {
                dllFileNames = Directory.GetFiles(PluginDirectory, "*.dll");
            }

            GC.Collect();
            GC.WaitForPendingFinalizers();

            LoadedPlugins = GenericPluginLoader <UniversalPluginFramework> .LoadPlugins(PluginDirectory);

            foreach (UniversalPluginFramework plugin in LoadedPlugins)
            {
                plugin.OnLoad(PluginEditDirectory + @"\" + plugin.Name);
            }
        }
Пример #11
0
        private void Painter_Load(object sender, EventArgs e)
        {
            ThiknesscomboBox.SelectedItem = ThiknesscomboBox.Items[0];
            ContourcolorDialog.Color      = Color.Black;
            ContourColorButton.BackColor  = ContourcolorDialog.Color;
            BrushColorDialog.Color        = Color.White;
            BrushColorButton.BackColor    = BrushColorDialog.Color;
            foreach (var tb in tbList)
            {
                tb.ReadOnly = true;
            }
            ICollection <Figure> plugins = GenericPluginLoader <Figure> .LoadPlugins("Plugins");

            if (plugins != null)
            {
                foreach (var p in plugins)
                {
                    FigureList.figures.Add(p);
                    //Figure_comboBox.Items.Add()
                }
            }
            //var house = new UserFigure("house");
            //house.UserFigureList.Add(new CompositFigure(new List<Point> { new Point(0, 100), new Point(100, 0), new Point(200, 100) }) { Figure = new Triangle() });
            //house.UserFigureList.Add(new CompositFigure(new List<Point> { new Point(100, 50), new Point(120, 50) }) { Figure = new Circle() });
            //Picture.Serialize(new List<Figure> { { house } }, "house.dat");

            var list = Picture.Deserialize("CustomFigures.dat");

            if (list != null)
            {
                foreach (var uf in list)
                {
                    Figure_comboBox.Items.Add(uf.GetName());
                    FigureList.figures.Add(uf);
                }
            }
            //Figure_comboBox.Items.Add(house.GetName());
            //FigureList.figures.Add(house);
            if (Figure_comboBox.Items.Count > 0)
            {
                Figure_comboBox.SelectedItem = Figure_comboBox.Items[0];
            }
        }
Пример #12
0
        public MainForm()
        {
            InitializeComponent();
            new DiscordPresence().Initialize();

            ShaderTools.executableDir = executableDir;

            Config.StartupFromFile(MainForm.executableDir + "\\config.xml");

            GenericPluginLoader.LoadPlugin();
            foreach (var plugin in GenericPluginLoader._Plugins)
            {
                plugin.Value.Load();
                LoadPluginContextMenus(plugin.Value.Types);
            }
            Settings settings = new Settings(this);

            settings.Close();
            Reload();
            LoadPluginFileContextMenus();
        }
Пример #13
0
        private void OkButton_Click(object sender, EventArgs e)
        {
            if (this.pluginChanges)
            {
                _ = MainForm.MessageManager.ShowInfo("A plugin was installed, uninstalled or updated. All plugins are about to be reloaded.", "Info!", Convert.ToBoolean(SettingsFile.SettingsJson.UseNotifications));
                var komloader        = new GenericPluginLoader <IKomPlugin>();
                var callbackloader   = new GenericPluginLoader <ICallbackPlugin>();
                var encryptionloader = new GenericPluginLoader <IEncryptionPlugin>();
#if NET5_0_OR_GREATER
                komloader.UnloadPlugins(MainForm.Contexts);
                MainForm.Contexts.Clear();
#else
                komloader.UnloadPlugins(MainForm.Domains);
                MainForm.Domains.Clear();
#endif
                var komplugins = komloader.LoadPlugins("plugins", out var domains1, Convert.ToBoolean(SettingsFile.SettingsJson.SaveToZip));
                KOMManager.Komplugins.AddRange(komplugins);
                var callbackplugins = callbackloader.LoadPlugins("plugins", out var domains2, Convert.ToBoolean(SettingsFile.SettingsJson.SaveToZip));
                KOMManager.Callbackplugins.AddRange(callbackplugins);
                var encryptionplugins = encryptionloader.LoadPlugins("plugins", out var domains3, Convert.ToBoolean(SettingsFile.SettingsJson.SaveToZip));
                KOMManager.Encryptionplugins.AddRange(encryptionplugins);
#if NET5_0_OR_GREATER
                MainForm.Contexts.AddRange(domains1);
                MainForm.Contexts.AddRange(domains2);
                MainForm.Contexts.AddRange(domains3);
#else
                MainForm.Domains.AddRange(domains1);
                MainForm.Domains.AddRange(domains2);
                MainForm.Domains.AddRange(domains3);
#endif
            }
            else
            {
                this.Close();
            }
        }
Пример #14
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            this.Hide();
            var closing = false;

            if (!Directory.Exists(Application.StartupPath + "\\koms"))
            {
                _ = Directory.CreateDirectory(Application.StartupPath + "\\koms");
            }

            if (ExecutionManager.IsElsKomRunning() == true)
            {
                _       = MessageManager.ShowError("Sorry, Only 1 Instance is allowed at a time.", "Error!", false);
                closing = true;
            }
            else
            {
                SettingsFile.Settingsxml = new XmlObject(SettingsFile.Path, "<Settings></Settings>");
                this.elsDir = SettingsFile.Settingsxml?.TryRead("ElsDir");
                if (this.elsDir.Length < 1)
                {
                    _ = MessageManager.ShowInfo("Welcome to Els_kom." + Environment.NewLine + "Now your fist step is to Configure Els_kom to the path that you have installed Elsword to and then you can Use the test Mods and the executing of the Launcher features. It will only take less than 1~3 minutes tops." + Environment.NewLine + "Also if you encounter any bugs or other things take a look at the Issue Tracker.", "Welcome!", false);

                    // avoids an issue where more than 1 settings form can be opened at the same time.
                    if (this.settingsfrm == null && this.aboutfrm == null)
                    {
                        this.settingsfrm = new SettingsForm();
                        _ = this.settingsfrm.ShowDialog();
                        this.settingsfrm.Dispose();
                        this.settingsfrm = null;
                    }
                }

                if (!int.TryParse(SettingsFile.Settingsxml?.TryRead("SaveToZip"), out var saveToZip1))
                {
                    // do nothing to silence a compile error.
                }

                if (!int.TryParse(SettingsFile.Settingsxml?.TryRead("LoadPDB"), out var loadPDB1))
                {
                    // do nothing to silence a compile error.
                }

                var komplugins = new GenericPluginLoader <IKomPlugin>().LoadPlugins("plugins", Convert.ToBoolean(saveToZip1), Convert.ToBoolean(loadPDB1));
                KOMManager.Komplugins.AddRange(komplugins);
                var callbackplugins = new GenericPluginLoader <ICallbackPlugin>().LoadPlugins("plugins", Convert.ToBoolean(saveToZip1), Convert.ToBoolean(loadPDB1));
                KOMManager.Callbackplugins.AddRange(callbackplugins);
                if (!GitInformation.GetAssemblyInstance(typeof(Els_kom_Main))?.IsMaster ?? false)
                {
                    _ = MessageManager.ShowInfo("This branch is not the master branch, meaning this is a feature branch to test changes. When finished please pull request them for the possibility of them getting merged into master.", "Info!", Convert.ToBoolean(Convert.ToInt32(SettingsFile.Settingsxml?.TryRead("UseNotifications") != string.Empty ? SettingsFile.Settingsxml?.TryRead("UseNotifications") : "0")));
                }

                if (GitInformation.GetAssemblyInstance(typeof(Els_kom_Main))?.IsDirty ?? false)
                {
                    var resp = MessageBox.Show("This build was compiled with Uncommitted changes. As a result, this build might be unstable. Are you sure you want to run this build to test some changes to the code?", "Info!", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (resp == DialogResult.No)
                    {
                        closing = true;
                    }
                }
            }

            if (!closing)
            {
                this.MessageManager1.Icon    = this.Icon;
                this.MessageManager1.Text    = this.Text;
                this.MessageManager1.Visible = true;
                var pluginTypes = new List <Type>();
                foreach (var callbackplugin in KOMManager.Callbackplugins)
                {
                    pluginTypes.Add(callbackplugin.GetType());
                }

                foreach (var komplugin in KOMManager.Komplugins)
                {
                    pluginTypes.Add(komplugin.GetType());
                }

                PluginUpdateChecks = PluginUpdateCheck.CheckForUpdates(
                    SettingsFile.Settingsxml?.TryRead("Sources", "Source", null),
                    pluginTypes);
                foreach (var pluginUpdateCheck in PluginUpdateChecks)
                {
                    // discard result.
                    var result = pluginUpdateCheck.ShowMessage;
                }

                this.Show();
                this.Activate();
            }
            else
            {
                SettingsFile.Settingsxml = null;
                this.aboutfrm?.Close();
                this.settingsfrm?.Close();
                this.Close();
            }
        }
Пример #15
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            this.Hide();
            this.packToolStripMenuItem.Image     = NativeMethods.ConvertSVGTo16x16Image(Properties.Resources.archive, ShareXResources.Theme.TextColor);
            this.unpackToolStripMenuItem.Image   = NativeMethods.ConvertSVGTo16x16Image(Properties.Resources.unarchive, ShareXResources.Theme.TextColor);
            this.testModsToolStripMenuItem.Image = NativeMethods.ConvertSVGTo16x16Image(Properties.Resources.vial_solid, ShareXResources.Theme.TextColor);
            this.launcherToolStripMenuItem.Image = NativeMethods.ConvertSVGTo16x16Image(Properties.Resources.launch, ShareXResources.Theme.TextColor);
            this.exitToolStripMenuItem.Image     = NativeMethods.GetNativeMenuItemImage(new IntPtr(NativeMethods.HBMMENU_POPUP_CLOSE), true);
            var closing = false;

            if (!Directory.Exists(Application.StartupPath + "\\koms"))
            {
                _ = Directory.CreateDirectory(Application.StartupPath + "\\koms");
            }

            if (ExecutionManager.IsElsKomRunning())
            {
                _       = MessageManager.ShowError("Sorry, Only 1 Instance is allowed at a time.", "Error!", false);
                closing = true;
            }
            else
            {
                this.elsDir = SettingsFile.SettingsJson.ElsDir;
                if (this.elsDir.Length < 1)
                {
                    _ = MessageManager.ShowInfo($"Welcome to Els_kom.{Environment.NewLine}Now your fist step is to Configure Els_kom to the path that you have installed Elsword to and then you can Use the test Mods and the executing of the Launcher features. It will only take less than 1~3 minutes tops.{Environment.NewLine}Also if you encounter any bugs or other things take a look at the Issue Tracker.", "Welcome!", false);

                    // avoids an issue where more than 1 settings form can be opened at the same time.
                    if (this.settingsfrm == null && this.aboutfrm == null)
                    {
                        using (this.settingsfrm = new SettingsForm())
                        {
                            _ = this.settingsfrm.ShowDialog();
                        }

                        this.settingsfrm = null;
                    }
                }

                var komplugins = new GenericPluginLoader <IKomPlugin>().LoadPlugins("plugins", out var domains1, Convert.ToBoolean(SettingsFile.SettingsJson.SaveToZip));
                KOMManager.Komplugins.AddRange(komplugins);
                var callbackplugins = new GenericPluginLoader <ICallbackPlugin>().LoadPlugins("plugins", out var domains2, Convert.ToBoolean(SettingsFile.SettingsJson.SaveToZip));
                KOMManager.Callbackplugins.AddRange(callbackplugins);
                var encryptionplugins = new GenericPluginLoader <IEncryptionPlugin>().LoadPlugins("plugins", out var domains3, Convert.ToBoolean(SettingsFile.SettingsJson.SaveToZip));
                KOMManager.Encryptionplugins.AddRange(encryptionplugins);
#if NET5_0_OR_GREATER
                Contexts.AddRange(domains1);
                Contexts.AddRange(domains2);
                Contexts.AddRange(domains3);
#else
                Domains.AddRange(domains1);
                Domains.AddRange(domains2);
                Domains.AddRange(domains3);
#endif
                if (!GitInformation.GetAssemblyInstance(typeof(Els_kom_Main))?.IsMain ?? false)
                {
                    _ = MessageManager.ShowInfo("This branch is not the main branch, meaning this is a feature branch to test changes. When finished please pull request them for the possibility of them getting merged into main.", "Info!", Convert.ToBoolean(SettingsFile.SettingsJson.UseNotifications));
                }

                if (GitInformation.GetAssemblyInstance(typeof(Els_kom_Main))?.IsDirty ?? false)
                {
                    var resp = MessageBox.Show("This build was compiled with Uncommitted changes. As a result, this build might be unstable. Are you sure you want to run this build to test some changes to the code?", "Info!", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (resp == DialogResult.No)
                    {
                        closing = true;
                    }
                }
            }

            if (!closing)
            {
                MessageManager.Icon = this.Icon;
                MessageManager.Text = this.Text;
                var pluginTypes = new List <Type>();
                pluginTypes.AddRange(KOMManager.Callbackplugins.Select((x) => x.GetType()));
                pluginTypes.AddRange(KOMManager.Komplugins.Select((x) => x.GetType()));
                pluginTypes.AddRange(KOMManager.Encryptionplugins.Select((x) => x.GetType()));
                PluginUpdateChecks = PluginUpdateCheck.CheckForUpdates(
                    SettingsFile.SettingsJson.Sources.Source.ToArray(),
                    pluginTypes,
                    Els_kom_Main.ServiceProvider);
                foreach (var pluginUpdateCheck in PluginUpdateChecks)
                {
                    // discard result.
                    _ = pluginUpdateCheck.ShowMessage;
                }

                MessageManager.Visible = true;
                this.Show();
                this.Activate();
            }
            else
            {
                SettingsFile.SettingsJson = null;
                this.aboutfrm?.Close();
                this.settingsfrm?.Close();
                this.Close();
            }
        }
Пример #16
0
        /// <summary>
        /// Initializes the MainControl's constants.
        /// </summary>
        public void LoadControl()
        {
            this.MakeTrayIcon();
            var closing = false;

            if (!Directory.Exists(Application.StartupPath + "\\koms"))
            {
                Directory.CreateDirectory(Application.StartupPath + "\\koms");
            }

            if (ExecutionManager.IsElsKomRunning() == true)
            {
                MessageManager.ShowError("Sorry, Only 1 Instance is allowed at a time.", "Error!", Convert.ToBoolean(Convert.ToInt32(SettingsFile.Settingsxml?.TryRead("UseNotifications") != string.Empty ? SettingsFile.Settingsxml?.TryRead("UseNotifications") : "0")));
                closing = true;
            }
            else
            {
                SettingsFile.Settingsxml = new XmlObject(SettingsFile.Path, "<Settings></Settings>");
                this.elsDir = SettingsFile.Settingsxml?.TryRead("ElsDir");
                if (this.elsDir.Length < 1)
                {
                    MessageManager.ShowInfo("Welcome to Els_kom." + Environment.NewLine + "Now your fist step is to Configure Els_kom to the path that you have installed Elsword to and then you can Use the test Mods and the executing of the Launcher features. It will only take less than 1~3 minutes tops." + Environment.NewLine + "Also if you encounter any bugs or other things take a look at the Issue Tracker.", "Welcome!", Convert.ToBoolean(Convert.ToInt32(SettingsFile.Settingsxml?.TryRead("UseNotifications") != string.Empty ? SettingsFile.Settingsxml?.TryRead("UseNotifications") : "0")));
                    this.ConfigForm?.Invoke(this, new EventArgs());
                }

                if (!int.TryParse(SettingsFile.Settingsxml?.TryRead("SaveToZip"), out var saveToZip1))
                {
                    // do nothing to silence a compile error.
                }

                if (!int.TryParse(SettingsFile.Settingsxml?.TryRead("LoadPDB"), out var loadPDB1))
                {
                    // do nothing to silence a compile error.
                }

                var komplugins = GenericPluginLoader <IKomPlugin> .LoadPlugins("plugins", Convert.ToBoolean(saveToZip1), Convert.ToBoolean(loadPDB1));

                KOMStream.Komplugins.AddRange(komplugins);
                var callbackplugins = GenericPluginLoader <ICallbackPlugin> .LoadPlugins("plugins", Convert.ToBoolean(saveToZip1), Convert.ToBoolean(loadPDB1));

                ExecutionManager.Callbackplugins.AddRange(callbackplugins);
                if (!Git.IsMaster)
                {
                    MessageManager.ShowInfo("This branch is not the master branch, meaning this is a feature branch to test changes. When finished please pull request them for the possibility of them getting merged into master.", "Info!", Convert.ToBoolean(Convert.ToInt32(SettingsFile.Settingsxml?.TryRead("UseNotifications") != string.Empty ? SettingsFile.Settingsxml?.TryRead("UseNotifications") : "0")));
                }

                if (Git.IsDirty)
                {
                    var resp = MessageBox.Show("This build was compiled with Uncommitted changes. As a result, this build might be unstable. Are you sure you want to run this build to test some changes to the code?", "Info!", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (resp == DialogResult.No)
                    {
                        closing = true;
                    }
                }
            }

            if (!closing)
            {
                if (this.components == null)
                {
                    this.components = new Container();
                }

                this.settingsTmr?.Dispose();
                this.settingsTmr = new System.Windows.Forms.Timer(this.components)
                {
                    Enabled  = true,
                    Interval = 1,
                };
                this.settingsTmr.Tick += new EventHandler(this.CheckSettings);
                this.packingTmr?.Dispose();
                this.packingTmr = new System.Windows.Forms.Timer(this.components)
                {
                    Enabled  = false,
                    Interval = 1,
                };
                this.packingTmr.Tick += new EventHandler(this.Packing);
                this.unpackingTmr?.Dispose();
                this.unpackingTmr = new System.Windows.Forms.Timer(this.components)
                {
                    Enabled  = false,
                    Interval = 1,
                };
                this.unpackingTmr.Tick += new EventHandler(this.Unpacking);
                this.testModsTmr?.Dispose();
                this.testModsTmr = new System.Windows.Forms.Timer(this.components)
                {
                    Enabled  = false,
                    Interval = 1,
                };
                this.testModsTmr.Tick += new EventHandler(this.TestMods2);
                this.launcherTmr?.Dispose();
                this.launcherTmr = new System.Windows.Forms.Timer(this.components)
                {
                    Enabled  = false,
                    Interval = 1,
                };
                this.launcherTmr.Tick            += new EventHandler(this.Launcher);
                MessageManager.NotifyIcon.Icon    = this.FindForm().Icon;
                MessageManager.NotifyIcon.Text    = this.FindForm().Text;
                MessageManager.NotifyIcon.Visible = true;
                var pluginTypes = new List <Type>();
                foreach (var callbackplugin in ExecutionManager.Callbackplugins)
                {
                    pluginTypes.Add(callbackplugin.GetType());
                }

                foreach (var komplugin in KOMStream.Komplugins)
                {
                    pluginTypes.Add(komplugin.GetType());
                }

                PluginUpdateChecks = PluginUpdateCheck.CheckForUpdates(
                    SettingsFile.Settingsxml?.TryRead("Sources", "Source", null),
                    pluginTypes);
                foreach (var pluginUpdateCheck in PluginUpdateChecks)
                {
                    // discard result.
                    var result = pluginUpdateCheck.ShowMessage;
                }

                this.FindForm().Show();
            }
            else
            {
                SettingsFile.Settingsxml = null;
                this.CloseForm?.Invoke(this, new EventArgs());
            }
        }