示例#1
0
 public void OnShowForm(object sender, RibbonEventArgs e) =>
 ShowForm?.Invoke(sender, e);
示例#2
0
        /// <summary>
        /// Initializes the MainControl's constants.
        /// </summary>
        public void LoadControl()
        {
            MakeTrayIcon();
            bool Closing = false;

            if (Classes.ExecutionManager.IsElsKomRunning() == true)
            {
                Classes.MessageManager.ShowError("Sorry, Only 1 Instance is allowed at a time.", "Error!");
                Closing = true;
            }
            else
            {
                if (System.IO.File.Exists(Classes.SettingsFile.Path))
                {
                    Classes.SettingsFile.Settingsxml = new Classes.XMLObject(Classes.SettingsFile.Path, "<Settings></Settings>");
                    ElsDir = Classes.SettingsFile.Settingsxml.Read("ElsDir");
                    if (ElsDir.Length < 1)
                    {
                        Classes.MessageManager.ShowInfo("Welcome to Els_kom." + System.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." + System.Environment.NewLine + "Also if you encounter any bugs or other things take a look at the Issue Tracker.", "Welcome!");
                        ConfigForm?.Invoke(this, new System.EventArgs());
                    }
                }
                else
                {
                    Classes.MessageManager.ShowInfo("Welcome to Els_kom." + System.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." + System.Environment.NewLine + "Also if you encounter any bugs or other things take a look at the Issue Tracker.", "Welcome!");
                    ConfigForm?.Invoke(this, new System.EventArgs());
                }
                System.Collections.Generic.ICollection <interfaces.IKomPlugin> _komplugins = Classes.GenericPluginLoader <interfaces.IKomPlugin> .LoadPlugins("plugins");

                Classes.KOMManager.komplugins = new System.Collections.Generic.List <interfaces.IKomPlugin>();
                foreach (var komplugin in _komplugins)
                {
                    Classes.KOMManager.komplugins.Add(komplugin);
                }
                System.Collections.Generic.ICollection <interfaces.ICallbackPlugin> _callbackplugins = Classes.GenericPluginLoader <interfaces.ICallbackPlugin> .LoadPlugins("plugins");

                Classes.ExecutionManager.callbackplugins = new System.Collections.Generic.List <interfaces.ICallbackPlugin>();
                foreach (var callbackplugins in _callbackplugins)
                {
                    Classes.ExecutionManager.callbackplugins.Add(callbackplugins);
                }
                if (!Classes.Git.IsMaster)
                {
                    Classes.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!");
                }
                if (Classes.Git.IsDirty)
                {
                    System.Windows.Forms.DialogResult resp = System.Windows.Forms.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!", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Information);
                    if (resp == System.Windows.Forms.DialogResult.No)
                    {
                        Closing = true;
                    }
                }
            }
            if (!Closing)
            {
                if (components == null)
                {
                    components = new System.ComponentModel.Container();
                }
                SettingsTmr = new System.Windows.Forms.Timer(components)
                {
                    Enabled  = true,
                    Interval = 1
                };
                PackingTmr = new System.Windows.Forms.Timer(components)
                {
                    Enabled  = false,
                    Interval = 1
                };
                PackingTmr.Tick += new System.EventHandler(Packing);
                UnpackingTmr     = new System.Windows.Forms.Timer(components)
                {
                    Enabled  = false,
                    Interval = 1
                };
                UnpackingTmr.Tick += new System.EventHandler(Unpacking);
                TestModsTmr        = new System.Windows.Forms.Timer(components)
                {
                    Enabled  = false,
                    Interval = 1
                };
                TestModsTmr.Tick += new System.EventHandler(TestMods2);
                LauncherTmr       = new System.Windows.Forms.Timer(components)
                {
                    Enabled  = false,
                    Interval = 1
                };
                LauncherTmr.Tick += new System.EventHandler(Launcher);
                ShowForm?.Invoke(this, new System.EventArgs());
            }
            else
            {
                Classes.SettingsFile.Settingsxml?.Dispose();
                CloseForm?.Invoke(this, new System.EventArgs());
            }
        }