• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Chummer.CommonFunctions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Chummer.CommonFunctions的典型用法代码示例。如果您正苦于以下问题:C# CommonFunctions类的具体用法?C# CommonFunctions怎么用?C# CommonFunctions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CommonFunctions类属于Chummer命名空间,在下文中一共展示了CommonFunctions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: frmCareer

        public frmCareer(Character objCharacter)
        {
            _objCharacter = objCharacter;
            _objOptions = _objCharacter.Options;

            _objFunctions = new CommonFunctions(_objCharacter);
            _objFunctions.ContextMenuArmor = cmsArmor;
            _objFunctions.ContextMenuArmorMod = cmsArmorMod;
            _objFunctions.ContextMenuCyberware = cmsCyberware;
            _objFunctions.ContextMenuGear = cmsGear;
            _objFunctions.ContextMenuVehicle = cmsVehicle;
            _objFunctions.ContextMenuVehicleMod = cmsVehicle;
            _objFunctions.ContextMenuWeapon = cmsWeapon;
            _objFunctions.ContextMenuWeaponAccessory = cmsWeaponAccessoryGear;
            _objFunctions.ContextMenuWeaponMod = cmsWeaponMod;

            _objImprovementManager = new ImprovementManager(_objCharacter);
            _objController = new MainController(_objCharacter);
            InitializeComponent();

            // Add EventHandlers for the MAG and RES enabled events and tab enabled events.
            _objCharacter.MAGEnabledChanged += objCharacter_MAGEnabledChanged;
            _objCharacter.RESEnabledChanged += objCharacter_RESEnabledChanged;
            _objCharacter.AdeptTabEnabledChanged += objCharacter_AdeptTabEnabledChanged;
            _objCharacter.MagicianTabEnabledChanged += objCharacter_MagicianTabEnabledChanged;
            _objCharacter.TechnomancerTabEnabledChanged += objCharacter_TechnomancerTabEnabledChanged;
            _objCharacter.CritterTabEnabledChanged += objCharacter_CritterTabEnabledChanged;
            _objCharacter.BlackMarketEnabledChanged += objCharacter_BlackMarketChanged;
            _objCharacter.SensitiveSystemChanged += objCharacter_SensitiveSystemChanged;
            _objCharacter.UneducatedChanged += objCharacter_UneducatedChanged;
            _objCharacter.UncouthChanged += objCharacter_UncouthChanged;
            _objCharacter.InfirmChanged += objCharacter_InfirmChanged;
            GlobalOptions.Instance.MRUChanged += PopulateMRU;

            LanguageManager.Instance.Load(this);

            // Update the text in the Menus so they can be merged with frmMain properly.
            foreach (ToolStripMenuItem objItem in mnuCreateMenu.Items.OfType<ToolStripMenuItem>())
            {
                if (objItem.Tag != null)
                {
                    objItem.Text = LanguageManager.Instance.GetString(objItem.Tag.ToString());
                }
            }

            _lvwKarmaColumnSorter = new ListViewColumnSorter();
            _lvwKarmaColumnSorter.SortColumn = 0;
            _lvwKarmaColumnSorter.Order = SortOrder.Descending;
            lstKarma.ListViewItemSorter = _lvwKarmaColumnSorter;
            _lvwNuyenColumnSorter = new ListViewColumnSorter();
            _lvwNuyenColumnSorter.SortColumn = 0;
            _lvwNuyenColumnSorter.Order = SortOrder.Descending;
            lstNuyen.ListViewItemSorter = _lvwNuyenColumnSorter;

            SetTooltips();
            MoveControls();
        }
开发者ID:janhelke,项目名称:chummer2,代码行数:57,代码来源:frmCareer.cs


示例2: frmCreate

        public frmCreate(Character objCharacter)
        {
            _objCharacter = objCharacter;
            _objOptions = _objCharacter.Options;
            _objFunctions = new CommonFunctions(_objCharacter);
            _objImprovementManager = new ImprovementManager(_objCharacter);
            _objController = new MainController(_objCharacter);
            InitializeComponent();

            // Add EventHandlers for the various events MAG, RES, Qualities, etc.
            _objCharacter.MAGEnabledChanged += objCharacter_MAGEnabledChanged;
            _objCharacter.RESEnabledChanged += objCharacter_RESEnabledChanged;
            _objCharacter.AdeptTabEnabledChanged += objCharacter_AdeptTabEnabledChanged;
            _objCharacter.MagicianTabEnabledChanged += objCharacter_MagicianTabEnabledChanged;
            _objCharacter.TechnomancerTabEnabledChanged += objCharacter_TechnomancerTabEnabledChanged;
            _objCharacter.InitiationTabEnabledChanged += objCharacter_InitiationTabEnabledChanged;
            _objCharacter.CritterTabEnabledChanged += objCharacter_CritterTabEnabledChanged;
            _objCharacter.BlackMarketEnabledChanged += objCharacter_BlackMarketDiscountChanged;
            _objCharacter.SkillsSection.UneducatedChanged += objCharacter_UneducatedChanged;
            _objCharacter.SkillsSection.UncouthChanged += objCharacter_UncouthChanged;
            _objCharacter.FriendsInHighPlacesChanged += objCharacter_FriendsInHighPlacesChanged;
            _objCharacter.SkillsSection.SchoolOfHardKnocksChanged += objCharacter_SchoolOfHardKnocksChanged;
            _objCharacter.ExConChanged += objCharacter_ExConChanged;
            _objCharacter.TrustFundChanged += objCharacter_TrustFundChanged;
            _objCharacter.SkillsSection.TechSchoolChanged += objCharacter_TechSchoolChanged;
            _objCharacter.RestrictedGearChanged += objCharacter_RestrictedGearChanged;
            _objCharacter.OverclockerChanged += objCharacter_OverclockerChanged;
            _objCharacter.MadeManChanged += objCharacter_MadeManChanged;
            _objCharacter.SkillsSection.LinguistChanged += objCharacter_LinguistChanged;
            _objCharacter.LightningReflexesChanged += objCharacter_LightningReflexesChanged;
            _objCharacter.FameChanged += objCharacter_FameChanged;
            _objCharacter.BornRichChanged += objCharacter_BornRichChanged;
            _objCharacter.ErasedChanged += objCharacter_ErasedChanged;

            tabSkillUc.ChildPropertyChanged += SkillPropertyChanged;

            GlobalOptions.Instance.MRUChanged += PopulateMRU;

            LanguageManager.Instance.Load(GlobalOptions.Instance.Language, this);

            // Update the text in the Menus so they can be merged with frmMain properly.
            foreach (ToolStripMenuItem objItem in mnuCreateMenu.Items.OfType<ToolStripMenuItem>())
            {
                if (objItem.Tag != null)
                {
                    objItem.Text = LanguageManager.Instance.GetString(objItem.Tag.ToString());
                }
            }

            SetTooltips();
            MoveControls();
        }
开发者ID:argo2445,项目名称:chummer5a,代码行数:52,代码来源:frmCreate.cs


示例3: frmCareer

        public frmCareer(Character objCharacter)
        {
            _objCharacter = objCharacter;
            _objOptions = _objCharacter.Options;
            _objFunctions = new CommonFunctions(_objCharacter);
            _objImprovementManager = new ImprovementManager(_objCharacter);
            _objController = new MainController(_objCharacter);
            InitializeComponent();

            // Add EventHandlers for the MAG and RES enabled events and tab enabled events.
            _objCharacter.MAGEnabledChanged += objCharacter_MAGEnabledChanged;
            _objCharacter.RESEnabledChanged += objCharacter_RESEnabledChanged;
            _objCharacter.AdeptTabEnabledChanged += objCharacter_AdeptTabEnabledChanged;
            _objCharacter.MagicianTabEnabledChanged += objCharacter_MagicianTabEnabledChanged;
            _objCharacter.TechnomancerTabEnabledChanged += objCharacter_TechnomancerTabEnabledChanged;
            _objCharacter.CritterTabEnabledChanged += objCharacter_CritterTabEnabledChanged;
            _objCharacter.SkillsSection.UneducatedChanged += objCharacter_UneducatedChanged;
            _objCharacter.SkillsSection.UncouthChanged += objCharacter_UncouthChanged;
            _objCharacter.FameChanged += objCharacter_FameChanged;
            tabSkillsUc.ChildPropertyChanged += SkillPropertyChanged;
            GlobalOptions.Instance.MRUChanged += PopulateMRU;

            LanguageManager.Instance.Load(GlobalOptions.Instance.Language, this);

            // Update the text in the Menus so they can be merged with frmMain properly.
            foreach (ToolStripMenuItem objItem in mnuCreateMenu.Items.OfType<ToolStripMenuItem>())
            {
                if (objItem.Tag != null)
                {
                    objItem.Text = LanguageManager.Instance.GetString(objItem.Tag.ToString());
                }
            }

            _lvwKarmaColumnSorter = new ListViewColumnSorter();
            _lvwKarmaColumnSorter.SortColumn = 0;
            _lvwKarmaColumnSorter.Order = SortOrder.Descending;
            lstKarma.ListViewItemSorter = _lvwKarmaColumnSorter;
            _lvwNuyenColumnSorter = new ListViewColumnSorter();
            _lvwNuyenColumnSorter.SortColumn = 0;
            _lvwNuyenColumnSorter.Order = SortOrder.Descending;
            lstNuyen.ListViewItemSorter = _lvwNuyenColumnSorter;

            SetTooltips();
            MoveControls();
        }
开发者ID:argo2445,项目名称:chummer5a,代码行数:45,代码来源:frmCareer.cs


示例4: frmCreate

        public frmCreate(Character objCharacter)
        {
            _objCharacter = objCharacter;
            _objOptions = _objCharacter.Options;
            _objFunctions = new CommonFunctions(_objCharacter);
            _objImprovementManager = new ImprovementManager(_objCharacter);
            _objController = new MainController(_objCharacter);
            InitializeComponent();

            // Add EventHandlers for the MAG and RES enabled events and tab enabled events.
            _objCharacter.MAGEnabledChanged += objCharacter_MAGEnabledChanged;
            _objCharacter.RESEnabledChanged += objCharacter_RESEnabledChanged;
            _objCharacter.AdeptTabEnabledChanged += objCharacter_AdeptTabEnabledChanged;
            _objCharacter.MagicianTabEnabledChanged += objCharacter_MagicianTabEnabledChanged;
            _objCharacter.TechnomancerTabEnabledChanged += objCharacter_TechnomancerTabEnabledChanged;
            _objCharacter.InitiationTabEnabledChanged += objCharacter_InitiationTabEnabledChanged;
            _objCharacter.CritterTabEnabledChanged += objCharacter_CritterTabEnabledChanged;
            _objCharacter.BlackMarketEnabledChanged += objCharacter_BlackMarketChanged;
            _objCharacter.UneducatedChanged += objCharacter_UneducatedChanged;
            _objCharacter.UncouthChanged += objCharacter_UncouthChanged;
            _objCharacter.InfirmChanged += objCharacter_InfirmChanged;
            GlobalOptions.Instance.MRUChanged += PopulateMRU;

            LanguageManager.Instance.Load(GlobalOptions.Instance.Language, this);

            // Update the text in the Menus so they can be merged with frmMain properly.
            foreach (ToolStripMenuItem objItem in mnuCreateMenu.Items.OfType<ToolStripMenuItem>())
            {
                if (objItem.Tag != null)
                {
                    objItem.Text = LanguageManager.Instance.GetString(objItem.Tag.ToString());
                }
            }

            SetTooltips();
            MoveControls();
        }
开发者ID:kingcortez905,项目名称:chummer5,代码行数:37,代码来源:frmCreate.cs


示例5: lblVehicleSource_Click

 private void lblVehicleSource_Click(object sender, EventArgs e)
 {
     CommonFunctions objCommon = new CommonFunctions(_objCharacter);
     _objFunctions.OpenPDF(lblVehicleSource.Text);
 }
开发者ID:cormanater,项目名称:chummer5a,代码行数:5,代码来源:frmCreate.cs


示例6: 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();
            }
		}
开发者ID:AMDX9,项目名称:chummer5a,代码行数:9,代码来源:frmMain.cs


示例7: ProcessBonus


//.........这里部分代码省略.........
                CreateImprovement("", objImprovementSource, strSourceName, Improvement.ImprovementType.Initiation, "",
                    ValueToInt(bonusNode.InnerText, intRating));
                _objCharacter.InitiateGrade += ValueToInt(bonusNode.InnerText, intRating);
            }

            // Check for Submersion.
            if (bonusNode.LocalName == ("submersion"))
            {
                Log.Info("submersion");
                Log.Info("submersion = " + bonusNode.OuterXml.ToString());
                Log.Info("Calling CreateImprovement");
                CreateImprovement("", objImprovementSource, strSourceName, Improvement.ImprovementType.Submersion, "",
                    ValueToInt(bonusNode.InnerText, intRating));
                _objCharacter.SubmersionGrade += ValueToInt(bonusNode.InnerText, intRating);
            }

            // Check for Skillwires.
            if (bonusNode.LocalName == ("skillwire"))
            {
                Log.Info("skillwire");
                Log.Info("skillwire = " + bonusNode.OuterXml.ToString());
                Log.Info("Calling CreateImprovement");
                CreateImprovement("", objImprovementSource, strSourceName, Improvement.ImprovementType.Skillwire, "",
                    ValueToInt(bonusNode.InnerText, intRating));
            }

            // Check for Hardwires.
            if (bonusNode.LocalName == ("hardwires"))
            {
                Log.Info("hardwire");
                Log.Info("hardwire = " + bonusNode.OuterXml.ToString());
                Log.Info("Calling CreateImprovement");
                Cyberware objCyberware = new Cyberware(_objCharacter);
                CommonFunctions _objFunctions = new CommonFunctions();
                objCyberware = _objFunctions.FindCyberware(strSourceName, _objCharacter.Cyberware);
                if (objCyberware == null)
                {
                    Log.Info("_strSelectedValue = " + _strSelectedValue);
                    Log.Info("_strForcedValue = " + _strForcedValue);

                    // Display the Select Skill window and record which Skill was selected.
                    frmSelectSkill frmPickSkill = new frmSelectSkill(_objCharacter);
                    if (strFriendlyName != "")
                        frmPickSkill.Description = LanguageManager.Instance.GetString("String_Improvement_SelectSkillNamed")
                            .Replace("{0}", strFriendlyName);
                    else
                        frmPickSkill.Description = LanguageManager.Instance.GetString("String_Improvement_SelectSkill");

                    Log.Info("selectskill = " + bonusNode.OuterXml.ToString());
                    if (bonusNode.OuterXml.Contains("skillgroup"))
                        frmPickSkill.OnlySkillGroup = bonusNode.Attributes["skillgroup"].InnerText;
                    else if (bonusNode.OuterXml.Contains("skillcategory"))
                        frmPickSkill.OnlyCategory = bonusNode.Attributes["skillcategory"].InnerText;
                    else if (bonusNode.OuterXml.Contains("excludecategory"))
                        frmPickSkill.ExcludeCategory = bonusNode.Attributes["excludecategory"].InnerText;
                    else if (bonusNode.OuterXml.Contains("limittoskill"))
                        frmPickSkill.LimitToSkill = bonusNode.Attributes["limittoskill"].InnerText;
                    else if (bonusNode.OuterXml.Contains("limittoattribute"))
                        frmPickSkill.LinkedAttribute = bonusNode.Attributes["limittoattribute"].InnerText;

                    if (_strForcedValue != "")
                    {
                        frmPickSkill.OnlySkill = _strForcedValue;
                        frmPickSkill.Opacity = 0;
                    }
                    frmPickSkill.ShowDialog();
开发者ID:Rockzo,项目名称:chummer5a,代码行数:67,代码来源:clsImprovement.cs


示例8: lblSkillName_Click

 private void lblSkillName_Click(object sender, EventArgs e)
 {
     string strBook = _objSkill.Source + " " + _objSkill.Page;
     CommonFunctions objCommon = new CommonFunctions();
     objCommon.OpenPDF(strBook);
     nudSkill.Focus();
 }
开发者ID:ltdouthit,项目名称:chummer5a,代码行数:7,代码来源:SkillControl.cs


示例9: lblCritterPowerSource_Click

 private void lblCritterPowerSource_Click(object sender, EventArgs e)
 {
     CommonFunctions objCommon = new CommonFunctions(_objCharacter);
     objCommon.OpenPDF(lblCritterPowerSource.Text);
 }
开发者ID:Vanatrix,项目名称:chummer5a,代码行数:5,代码来源:frmSelectCritterPower.cs


示例10: tsUndoNuyenExpense_Click

        private void tsUndoNuyenExpense_Click(object sender, EventArgs e)
        {
            ListViewItem objItem = new ListViewItem();

            try
            {
                objItem = lstNuyen.SelectedItems[0];
            }
            catch
            {
                return;
            }

            CommonFunctions objCommon = new CommonFunctions(_objCharacter);

            ExpenseLogEntry objEntry = new ExpenseLogEntry();
            objItem = lstNuyen.SelectedItems[0];

            // Find the selected Nuyen Expense.
            foreach (ExpenseLogEntry objCharacterEntry in _objCharacter.ExpenseEntries)
            {
                if (objCharacterEntry.InternalId == objItem.SubItems[3].Text)
                {
                    objEntry = objCharacterEntry;
                    break;
                }
            }

            if (objEntry.Undo == null)
            {
                MessageBox.Show(LanguageManager.Instance.GetString("Message_UndoNoHistory"), LanguageManager.Instance.GetString("MessageTitle_NoUndoHistory"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else if (objEntry.Undo.KarmaType == KarmaExpenseType.ImproveInitiateGrade)
            {
                // Get the grade of the item we're undoing and make sure it's the highest grade
                int intMaxGrade = 0;
                foreach (InitiationGrade objGrade in _objCharacter.InitiationGrades)
                {
                    intMaxGrade = Math.Max(intMaxGrade, objGrade.Grade);
                }
                foreach (InitiationGrade objGrade in _objCharacter.InitiationGrades)
                {
                    if (objGrade.InternalId == objEntry.Undo.ObjectId)
                    {
                        if (objGrade.Grade < intMaxGrade)
                        {
                            MessageBox.Show(LanguageManager.Instance.GetString("Message_UndoNotHighestGrade"), LanguageManager.Instance.GetString("MessageTitle_NotHighestGrade"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                        break;
                    }
                }
                if (MessageBox.Show(LanguageManager.Instance.GetString("Message_UndoExpense"), LanguageManager.Instance.GetString("MessageTitle_UndoExpense"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    return;
            }
            else
            {
                if (MessageBox.Show(LanguageManager.Instance.GetString("Message_UndoExpense"), LanguageManager.Instance.GetString("MessageTitle_UndoExpense"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    return;
            }

            switch (objEntry.Undo.NuyenType)
            {
                case NuyenExpenseType.AddCyberware:
                    // Locate the Cyberware that was added.
                    int intOldPenalty = 0;
                    int intNewPenalty = 0;
                    foreach (Cyberware objCyberware in _objCharacter.Cyberware)
                    {
                        if (objCyberware.InternalId == objEntry.Undo.ObjectId)
                        {
                            foreach (Cyberware objChild in objCyberware.Children)
                            {
                                // Remove the Improvements created by child items.
                                _objImprovementManager.RemoveImprovements(Improvement.ImprovementSource.Cyberware, objChild.InternalId);
                                _objImprovementManager.RemoveImprovements(Improvement.ImprovementSource.Bioware, objChild.InternalId);
                            }
                            // Remove the Improvements created by the item.
                            _objImprovementManager.RemoveImprovements(Improvement.ImprovementSource.Cyberware, objCyberware.InternalId);
                            _objImprovementManager.RemoveImprovements(Improvement.ImprovementSource.Bioware, objCyberware.InternalId);

                            // Determine the character's Essence penalty before removing the Cyberware.
                            intOldPenalty = _objCharacter.EssencePenalty;
                            // Remove the Cyberware.
                            _objCharacter.Cyberware.Remove(objCyberware);
                            // Determine the character's Essence penalty after removing the Cyberware.
                            intNewPenalty = _objCharacter.EssencePenalty;

                            // Restore the character's MAG/RES if they have it.
                            //if (!_objCharacter.OverrideSpecialAttributeEssenceLoss && !_objCharacter.OverrideSpecialAttributeEssenceLoss)
                            //{
                            //    if (intOldPenalty != intNewPenalty)
                            //    {
                            //        if (_objCharacter.MAGEnabled)
                            //            _objCharacter.MAG.Value += (intOldPenalty - intNewPenalty);
                            //        if (_objCharacter.RESEnabled)
                            //            _objCharacter.RES.Value += (intOldPenalty - intNewPenalty);
                            //    }
                            //}
//.........这里部分代码省略.........
开发者ID:Althalusdlg,项目名称:chummer5a,代码行数:101,代码来源:frmCareer.cs


示例11: lblPowerName_Click

 private void lblPowerName_Click(object sender, EventArgs e)
 {
     string strBook = _objPower.Source + " " + _objPower.Page;
     CommonFunctions objCommon = new CommonFunctions();
     objCommon.OpenPDF(strBook);
 }
开发者ID:AMDX9,项目名称:chummer5a,代码行数:6,代码来源:PowerControl.cs


示例12: SetToolTips

        private void SetToolTips()
        {
            const int width = 50;
            var functions = new CommonFunctions();

            tipTooltip.SetToolTip(chkKnucks, functions.WordWrap(LanguageManager.Instance.GetString("Tip_OptionsKnucks"), width));
            tipTooltip.SetToolTip(chkIgnoreArt, functions.WordWrap(LanguageManager.Instance.GetString("Tip_OptionsIgnoreArt"), width));
            tipTooltip.SetToolTip(chkCyberlegMovement, functions.WordWrap(LanguageManager.Instance.GetString("Tip_OptionsCyberlegMovement"), width));
            tipTooltip.SetToolTip(chkDontDoubleQualities, functions.WordWrap(LanguageManager.Instance.GetString("Tip_OptionsDontDoubleQualities"), width));
            tipTooltip.SetToolTip(chkUsePointsOnBrokenGroups, functions.WordWrap(LanguageManager.Instance.GetString("Tip_OptionsUsePointsOnBrokenGroups"), width));
            tipTooltip.SetToolTip(chkAllowInitiation, functions.WordWrap(LanguageManager.Instance.GetString("Tip_OptionsAllowInitiation"), width));
        }
开发者ID:Vanatrix,项目名称:chummer5a,代码行数:12,代码来源:frmOptions.cs


示例13: cmdPDFTest_Click

        private void cmdPDFTest_Click(object sender, EventArgs e)
        {
            if (txtPDFLocation.Text == string.Empty)
                return;

            SaveRegistrySettings();

            CommonFunctions objCommon = new CommonFunctions(null);
            objCommon.OpenPDF(treSourcebook.SelectedNode.Tag + " 5");
        }
开发者ID:Vanatrix,项目名称:chummer5a,代码行数:10,代码来源:frmOptions.cs


示例14: MainController

 public MainController(Character objCharacter)
 {
     _objCharacter = objCharacter;
     _objImprovementManager = new ImprovementManager(_objCharacter);
     _objFunctions = new CommonFunctions(_objCharacter);
 }
开发者ID:Nebual,项目名称:chummer,代码行数:6,代码来源:clsMainController.cs


示例15: 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());
        }
开发者ID:kingcortez905,项目名称:chummer5,代码行数:41,代码来源:frmOptions.cs



注:本文中的Chummer.CommonFunctions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Chummer.ComplexForm类代码示例发布时间:2022-05-24
下一篇:
C# Chummer.Character类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap