本文整理汇总了C#中Chummer.CommonFunctions.LogFlush方法的典型用法代码示例。如果您正苦于以下问题:C# CommonFunctions.LogFlush方法的具体用法?C# CommonFunctions.LogFlush怎么用?C# CommonFunctions.LogFlush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chummer.CommonFunctions
的用法示例。
在下文中一共展示了CommonFunctions.LogFlush方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: frmMain_Load
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();
}
}
示例2: SaveRegistrySettings
/// <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());
}