void ExitToolStripMenuItem_Click(object sender, EventArgs e) { Timer1.Enabled = false; Timer2.Enabled = false; timer5.Enabled = false; CloseForm?.Invoke(this, new EventArgs()); }
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; } }
public Loader() { Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); DelLang(); InitializeComponent(); SqlStartCheck.Start(); pictureBox1.Visible = false; pictureBox2.Visible = false; pictureBox3.Visible = false; switch (GetRandomInt()) { case 0: pictureBox1.Visible = true; break; case 1: pictureBox2.Visible = true; break; case 2: pictureBox3.Visible = true; break; } Opacity = 0; ShowSplashScreen.Start(); CloseForm.Start(); }
private void FrmCreateNewMod_FormClosed(object sender, FormClosedEventArgs e) { Close(); if (DialogResult != DialogResult.OK) { CloseForm?.Invoke(this); } }
/// <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); }
private void CloseApp() { if (this.InvokeRequired) { CloseForm s = new CloseForm(CloseApp); this.Invoke(s, new object[] { }); } else { this.Close(); } }
public ResultGrind(int[] RusultG) { InitializeComponent(); AttemptsGrind.Content = RusultG[0]; AttemptsSuccess.Content = RusultG[1]; AttemptsFail.Content = RusultG[2]; CF = CloseThis; ThToClose = new Thread(WaitAndCloseForm); ThToClose.Start(); }
public void CanCloseForm() { if (InvokeRequired) { Invoked = true; var d = new CloseForm(CanCloseForm); Invoke(d); } else { Close(); } }
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()); } }
private void Init() { Thread.Sleep(1000); ShowS show = ShowStatus; Failed fail = InitFailed; CloseForm close = CloseFormFunction; XMLIni ini = new XMLIni(); this.Invoke(show, Resource.lHelper.Key("m7")); if (ini.Init() <= 0) { this.Invoke(fail, null); return; } Thread.Sleep(1000); this.Invoke(show, Resource.lHelper.Key("m8")); Thread.Sleep(1000); this.Invoke(close); }
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); } }
void cmdOK_Click(object sender, System.EventArgs e) { CloseForm?.Invoke(this, new System.EventArgs()); }
private void WrapperFinished() { if (this.InvokeRequired) { CloseForm closeForm = new CloseForm(WrapperFinished); this.Invoke(closeForm, null); } else { this.Close(); } }
void Button2_Click(object sender, System.EventArgs e) { CloseForm?.Invoke(this, new EventArgs()); }
/// <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()); } }
private void buttonCancel_Click(object sender, EventArgs e) { CloseForm?.Invoke(); Close(); }
private void ViewUserForm_FormClosed(object sender, FormClosedEventArgs e) { CloseForm?.Invoke(); }
private void Web_DownloadFileZipCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { label.Text = lbupdate3; CloseForm?.Invoke(null, null); IsUpdating = false; }