private void SaveSettings() { if (_settings == null) { _settings = new ApplicationSettings(); } _settings.WindowPositionX = Location.X; _settings.WindowPositionY = Location.Y; _settings.WindowHeight = Size.Height; _settings.WindowWidth = Size.Width; _settings.FormWindowState = WindowState; _settings.BackgroundColorRed = textToEncrypt.BackColor.R; _settings.BackgroundColorGreen = textToEncrypt.BackColor.G; _settings.BackgroundColorBlue = textToEncrypt.BackColor.B; _settings.ForegroundColorRed = textToEncrypt.ForeColor.R; _settings.ForegroundColorGreen = textToEncrypt.ForeColor.G; _settings.ForegroundColorBlue = textToEncrypt.ForeColor.B; _settings.WordWrap = wordWrapToolStripMenuItem.Checked; _settings.DisableUpgradeNoticeVersion11 = _upgradeNotice.DontShowThisAgain; SettingsWriter.WriteSettingsFile(_settings); }
private void SaveSettings() { if (_settings == null) { _settings = new ApplicationSettings(); } _settings.WindowPositionX = Location.X; _settings.WindowPositionY = Location.Y; _settings.WindowHeight = Size.Height; _settings.WindowWidth = Size.Width; _settings.FormWindowState = WindowState; if (_settings.FormWindowState == FormWindowState.Minimized) { _settings.FormWindowState = FormWindowState.Maximized; _settings.WindowWidth = Screen.PrimaryScreen.Bounds.Width; _settings.WindowHeight = Screen.PrimaryScreen.Bounds.Height; } _settings.DetectUrl = richTextBox.DetectUrls; _settings.WordWrap = richTextBox.WordWrap; _settings.BackgroundColorRed = richTextBox.BackColor.R; _settings.BackgroundColorGreen = richTextBox.BackColor.G; _settings.BackgroundColorBlue = richTextBox.BackColor.B; _settings.ForegroundColorRed = richTextBox.ForeColor.R; _settings.ForegroundColorGreen = richTextBox.ForeColor.G; _settings.ForegroundColorBlue = richTextBox.ForeColor.B; SettingsWriter.WriteSettingsFile(_settings); }