using Deltares.MStab.Properties; namespace Deltares.MStab { public class ProgramSettings { //MStab Application: customized fields private bool isMaterialAssingCheckBoxChecked = false; //View->Materials private bool isModuleOkButtonOn = false; //Boolean for Module Tab Page Used in Start Up dialog private bool isMstabCheckBoxChecked = false; private bool isProbablisticCheckBoxChecked = false; //Mainform template custom fields from MStab private bool isPropertiesCheckBoxChecked = false; //View->properties private bool isReliabilityCheckBoxChecked = false; private bool isShowAtStartCheckBoxChecked = false; private bool isSpencerCheckBoxChecked = false; private bool isTitlePanelCheckBoxChecked = false; //Boolean for Main form View Menu Title panel check box private bool isUpliftCheckBoxChecked = false; private bool viewIsToolBarCheckBox = false; //Boolean for Main form View Menu Tool Bar check box private bool viewIstatusBarCheckBox = false; //Boolean for Main form View Menu Status Bar check bo public ProgramSettings() {} public bool IsMstabCheckBoxChecked { get { return isMstabCheckBoxChecked; } set { isMstabCheckBoxChecked = value; if (value == false) { isSpencerCheckBoxChecked = value; isUpliftCheckBoxChecked = value; isReliabilityCheckBoxChecked = value; isProbablisticCheckBoxChecked = value; } } } public bool IsSpencerCheckBoxChecked { get { return isSpencerCheckBoxChecked; } set { isSpencerCheckBoxChecked = value; if (value == true) { isMstabCheckBoxChecked = value; } } } public bool IsUpliftCheckBoxChecked { get { return isUpliftCheckBoxChecked; } set { isUpliftCheckBoxChecked = value; if (value == true) { isMstabCheckBoxChecked = true; } else { isReliabilityCheckBoxChecked = false; } } } public bool IsReliabilityCheckBoxChecked { get { return isReliabilityCheckBoxChecked; } set { isReliabilityCheckBoxChecked = value; if (value == true) { isUpliftCheckBoxChecked = true; isMstabCheckBoxChecked = true; } } } public bool IsProbablisticCheckBoxChecked { get { return isProbablisticCheckBoxChecked; } set { isProbablisticCheckBoxChecked = value; if (value == true) { isMstabCheckBoxChecked = true; } } } public bool IsShowAtStartCheckBoxChecked { get { return isShowAtStartCheckBoxChecked; } set { isShowAtStartCheckBoxChecked = value; } } public bool IsPropertiesCheckBoxChecked { get { return isPropertiesCheckBoxChecked; } set { isPropertiesCheckBoxChecked = value; } } public bool IsMaterialAssingCheckBoxChecked { get { return isMaterialAssingCheckBoxChecked; } set { isMaterialAssingCheckBoxChecked = value; } } public bool IsTitlePanelCheckBoxChecked { get { return isTitlePanelCheckBoxChecked; } set { isTitlePanelCheckBoxChecked = value; } } public bool IsModuleOkButtonOn { get { return isModuleOkButtonOn; } set { isModuleOkButtonOn = value; } } /// /// Populate AppSettings With The Latest opened files /// public void UpdateSettingsFileOnClose() { //for module Tab Page Controls Settings.Default.IsModuleMStab = isMstabCheckBoxChecked; Settings.Default.IsModuleSpencerModel = isSpencerCheckBoxChecked; Settings.Default.IsModuleUpliftVanmodel = isUpliftCheckBoxChecked; Settings.Default.IsModuleReliability = isReliabilityCheckBoxChecked; Settings.Default.IsModuleProbabilistic = isProbablisticCheckBoxChecked; Settings.Default.IsShowAtStart = isShowAtStartCheckBoxChecked; //for Application View Tab Page Settings.Default.AppViewIsProperties = isPropertiesCheckBoxChecked; Settings.Default.AppViewIsMaterialAssing = isMaterialAssingCheckBoxChecked; Settings.Default.AppViewIsTitlePanel = isTitlePanelCheckBoxChecked; //for view tab page Settings.Default.ViewIstatusBar = viewIstatusBarCheckBox; Settings.Default.ViewIsToolBar = viewIsToolBarCheckBox; //Save App Settings Settings.Default.Save(); } //Loads from App Settings public void GetSettingsOnLoad() { isMstabCheckBoxChecked = Settings.Default.IsModuleMStab; isSpencerCheckBoxChecked = Settings.Default.IsModuleSpencerModel; isUpliftCheckBoxChecked = Settings.Default.IsModuleUpliftVanmodel; isReliabilityCheckBoxChecked = Settings.Default.IsModuleReliability; isProbablisticCheckBoxChecked = Settings.Default.IsModuleProbabilistic; isShowAtStartCheckBoxChecked = Settings.Default.IsShowAtStart; //for Application View Tab Page isPropertiesCheckBoxChecked = Settings.Default.AppViewIsProperties; isMaterialAssingCheckBoxChecked = Settings.Default.AppViewIsMaterialAssing; //for view tab page controls viewIstatusBarCheckBox = Settings.Default.ViewIstatusBar; viewIsToolBarCheckBox = Settings.Default.ViewIsToolBar; } public void CopySettings(ProgramSettings aTempProgramSettings) { //For Modules Tab Page isMstabCheckBoxChecked = aTempProgramSettings.IsMstabCheckBoxChecked; isSpencerCheckBoxChecked = aTempProgramSettings.IsSpencerCheckBoxChecked; isUpliftCheckBoxChecked = aTempProgramSettings.IsUpliftCheckBoxChecked; isReliabilityCheckBoxChecked = aTempProgramSettings.IsReliabilityCheckBoxChecked; isProbablisticCheckBoxChecked = aTempProgramSettings.IsProbablisticCheckBoxChecked; isShowAtStartCheckBoxChecked = aTempProgramSettings.IsShowAtStartCheckBoxChecked; } } }