private void frmMain_Load(object sender, EventArgs e) { if (GlobalOptions.Instance.StartupFullscreen) { this.WindowState = FormWindowState.Maximized; } if (GlobalOptions.Instance.UseLogging) { CommonFunctions objFunctions = new CommonFunctions(); objFunctions.LogFlush(); } }
private void frmMain_Load(object sender, EventArgs e) { if (GlobalOptions.Instance.StartupFullscreen) this.WindowState = FormWindowState.Maximized; if (GlobalOptions.Instance.UseLogging) { CommonFunctions objFunctions = new CommonFunctions(); objFunctions.LogFlush(); } }
/// <summary> /// Save the global settings to the registry. /// </summary> private void SaveRegistrySettings() { // If we're just now enabling logging, flush the log if (!GlobalOptions.Instance.UseLogging && chkUseLogging.Checked) { CommonFunctions objFunctions = new CommonFunctions(); objFunctions.LogFlush(); } // Set Registry values. GlobalOptions.Instance.AutomaticUpdate = chkAutomaticUpdate.Checked; GlobalOptions.Instance.LocalisedUpdatesOnly = chkLocalisedUpdatesOnly.Checked; GlobalOptions.Instance.UseLogging = chkUseLogging.Checked; GlobalOptions.Instance.Language = cboLanguage.SelectedValue.ToString(); GlobalOptions.Instance.StartupFullscreen = chkStartupFullscreen.Checked; GlobalOptions.Instance.SingleDiceRoller = chkSingleDiceRoller.Checked; GlobalOptions.Instance.DefaultCharacterSheet = cboXSLT.SelectedValue.ToString(); GlobalOptions.Instance.DatesIncludeTime = chkDatesIncludeTime.Checked; GlobalOptions.Instance.PrintToFileFirst = chkPrintToFileFirst.Checked; GlobalOptions.Instance.PDFAppPath = txtPDFAppPath.Text; Microsoft.Win32.RegistryKey objRegistry = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Software\\Chummer5"); objRegistry.SetValue("autoupdate", chkAutomaticUpdate.Checked.ToString()); objRegistry.SetValue("localisedupdatesonly", chkLocalisedUpdatesOnly.Checked.ToString()); objRegistry.SetValue("uselogging", chkUseLogging.Checked.ToString()); objRegistry.SetValue("language", cboLanguage.SelectedValue.ToString()); objRegistry.SetValue("startupfullscreen", chkStartupFullscreen.Checked.ToString()); objRegistry.SetValue("singlediceroller", chkSingleDiceRoller.Checked.ToString()); objRegistry.SetValue("defaultsheet", cboXSLT.SelectedValue.ToString()); objRegistry.SetValue("datesincludetime", chkDatesIncludeTime.Checked.ToString()); objRegistry.SetValue("printtofilefirst", chkPrintToFileFirst.Checked.ToString()); objRegistry.SetValue("pdfapppath", txtPDFAppPath.Text); // Save the SourcebookInfo. Microsoft.Win32.RegistryKey objSourceRegistry = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Software\\Chummer5\\Sourcebook"); foreach (SourcebookInfo objSource in GlobalOptions.Instance.SourcebookInfo) objSourceRegistry.SetValue(objSource.Code, objSource.Path + "|" + objSource.Offset.ToString()); }