예제 #1
0
 void ExitToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Timer1.Enabled = false;
     Timer2.Enabled = false;
     timer5.Enabled = false;
     CloseForm?.Invoke(this, new EventArgs());
 }
예제 #2
0
 protected override void View_SaveData(object sender, EventArgs e)
 {
     base.View_SaveData(sender, e);
     try
     {
         Setting.Instance.LocalPort        = int.Parse(View.LocalPort_Text);
         Setting.Instance.RemotePort       = int.Parse(View.RemotePort_Text);
         Setting.Instance.RemoteClientPath = View.RemoteClientPath;
         Setting.Instance.RemoteClientArgs = View.RemoteClientArgs;
         Setting.Instance.HideClient       = View.HideClient_Toggle;
         AutoStart.Set(View.AutoStart_Toggle);
         Setting.Instance.Save();
         CloseForm?.Invoke(this, EventArgs.Empty);
     }
     catch (FormatException)
     {
         MsgBox.Error("Illegal port number format");
         return;
     }
     catch (Exception ex)
     {
         MsgBox.Error(ex.Message);
         return;
     }
 }
예제 #3
0
 private void FrmCreateNewMod_FormClosed(object sender, FormClosedEventArgs e)
 {
     Close();
     if (DialogResult != DialogResult.OK)
     {
         CloseForm?.Invoke(this);
     }
 }
예제 #4
0
 /// <summary>
 /// Shows the Version Error message and closes the main form if the checked version is not the same.
 /// </summary>
 public bool VersionCheck(string version)
 {
     if (Classes.Version.version != version)
     {
         Classes.MessageManager.ShowError("Sorry, you cannot use Els_kom.exe from this version with a newer or older Core. Please update the executable as well.", "Error!");
         CloseForm?.Invoke(this, new System.EventArgs());
         return(false);
     }
     return(true);
 }
예제 #5
0
        private void ExitToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            bool Cancel = false;

            if (Classes.ExecutionManager.GetRunningElsword() || Classes.ExecutionManager.GetRunningElswordDirectly() || Classes.KOMManager.GetPackingState() || Classes.KOMManager.GetUnpackingState())
            {
                Cancel = true;
                Classes.MessageManager.ShowInfo("Cannot close Els_kom while packing, unpacking, testing mods, or updating the game.", "Info!");
            }
            if (!Cancel)
            {
                end_settings_loop = true;
                Classes.SettingsFile.Settingsxml.Dispose();
                CloseForm?.Invoke(this, new System.EventArgs());
            }
        }
예제 #6
0
        private void EnableButtons()
        {
            if (CloseForm.InvokeRequired)
            {
                CloseForm.Invoke(new MethodInvoker(delegate { CloseForm.Enabled = true; }));
            }
            else
            {
                CloseForm.Enabled = true;
            }

            if (GetImage.InvokeRequired)
            {
                GetImage.Invoke(new MethodInvoker(delegate { GetImage.Text = pictureDialog.GetButtonText(RetryCounter); }));
                GetImage.Invoke(new MethodInvoker(delegate { GetImage.Enabled = true; }));
            }
            else
            {
                GetImage.Enabled = true;
                GetImage.Text    = pictureDialog.GetButtonText(RetryCounter);
            }
        }
 private void ViewUserForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     CloseForm?.Invoke();
 }
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     CloseForm?.Invoke();
     Close();
 }
예제 #9
0
 void cmdOK_Click(object sender, System.EventArgs e)
 {
     CloseForm?.Invoke(this, new System.EventArgs());
 }
예제 #10
0
 void Button2_Click(object sender, System.EventArgs e)
 {
     CloseForm?.Invoke(this, new EventArgs());
 }
예제 #11
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());
            }
        }
예제 #12
0
 private void Web_DownloadFileZipCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
 {
     label.Text = lbupdate3;
     CloseForm?.Invoke(null, null);
     IsUpdating = false;
 }