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 SaveSettings() { SaveProfile(); SettingsWriter sw = new SettingsWriter("CUE Tools", "settings.txt", Application.ExecutablePath); SaveScripts(SelectedAction); sw.Save("LastMOTD", lastMOTD); sw.Save("ChoiceWidth", _choiceWidth); sw.Save("ChoiceHeight", _choiceHeight); sw.Save("ChoiceMaxed", _choiceMaxed); sw.Save("InputPath", InputPath); sw.Save("DefaultLosslessFormat", _defaultLosslessFormat); sw.Save("DefaultLossyFormat", _defaultLossyFormat); sw.Save("DefaultHybridFormat", _defaultHybridFormat); sw.Save("DefaultNoAudioFormat", _defaultNoAudioFormat); sw.Save("DontGenerate", !_outputPathUseTemplate); sw.Save("OutputPathUseTemplates", comboBoxOutputFormat.Items.Count - OutputPathUseTemplates.Length); for (int iFormat = comboBoxOutputFormat.Items.Count - 1; iFormat >= OutputPathUseTemplates.Length; iFormat--) sw.Save(string.Format("OutputPathUseTemplate{0}", iFormat - OutputPathUseTemplates.Length), comboBoxOutputFormat.Items[iFormat].ToString()); sw.Save("UsePregapForFirstTrackInSingleFile", _usePregapForFirstTrackInSingleFile); sw.Save("ReducePriority", _reducePriority); sw.Save("FileBrowserState", (int)FileBrowserState); sw.Save("ReportState", ReportState); sw.Save("CorrectorLookup", (int)CorrectorMode); sw.Save("CorrectorOverwrite", toolStripButtonCorrectorOverwrite.Checked); sw.Save("CorrectorFormat", toolStripDropDownButtonCorrectorFormat.Text); sw.Save("WidthIncrement", FileBrowserState == FileBrowserStateEnum.Hidden ? SizeIncrement.Width : Width - OpenMinimumSize.Width); sw.Save("HeightIncrement", !ReportState ? SizeIncrement.Height : Height - OpenMinimumSize.Height); sw.Save("Top", Top); sw.Save("Left", Left); StringBuilder profiles = new StringBuilder(); foreach (ToolStripItem item in toolStripDropDownButtonProfile.DropDownItems) if (item != toolStripTextBoxAddProfile && item != toolStripMenuItemDeleteProfile && item != defaultToolStripMenuItem && item != toolStripSeparator5 ) { if (profiles.Length > 0) profiles.Append(' '); profiles.Append(item.Text); } sw.Save("Profiles", profiles.ToString()); _defaultProfile.Save(sw); sw.Close(); }
private void SaveProfile() { _profile._outputAudioType = SelectedOutputAudioType; _profile._outputAudioFormat = SelectedOutputAudioFormat; _profile._action = SelectedAction; _profile._CUEStyle = SelectedCUEStyle; _profile._writeOffset = (int)numericWriteOffset.Value; _profile._outputTemplate = comboBoxOutputFormat.Text; _profile._script = SelectedScript; _profile._useFreeDb = checkBoxUseFreeDb.Checked; _profile._useMusicBrainz = checkBoxUseMusicBrainz.Checked; _profile._useAccurateRip = checkBoxUseAccurateRip.Checked; _profile._useCUEToolsDB = checkBoxVerifyUseCDRepair.Checked; _profile._useLocalDB = checkBoxVerifyUseLocal.Checked; _profile._skipRecent = checkBoxSkipRecent.Checked; if (_profile != _defaultProfile) { SettingsWriter sw = new SettingsWriter("CUE Tools", string.Format("profile-{0}.txt", _profile._name), Application.ExecutablePath); _profile.Save(sw); sw.Close(); } }
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 { } } }