/*=== overrides ===*/ // Reload the global options. public override void Load() { string file = Paths.GetGlobalOptionsFilename(); GlobalOptionsSet os = null; // Load the global options. XmlUtility.LoadXml(file, ref os); if (os == null) { this.Options = new List <OptionsElement>(); } else { this.Options = os.Options; } // If the 'GlobalOptionsConfigurationName' configuration does not exist, add it. if (GetConfiguration(GlobalConfigurationName, GlobalPlatformName) == null) { OptionsElement oe = new OptionsElement(); oe.Configuration = GlobalConfigurationName; oe.Platform = GlobalPlatformName; AddConfiguration(oe); // Save the new global options. Save(); } }
// Save the global options. public override void Save() { string file = Paths.GetGlobalOptionsFilename(); GlobalOptionsSet os = this; if (!XmlUtility.SaveXml(file, ref os)) { MessageBox.Show("opC++ unable to save global options file '" + file + "'."); } }
public static GlobalOptionsSet GetGlobalOptions() { if (GlobalOptions == null) { GlobalOptions = new GlobalOptionsSet(); GlobalOptions.Load(); } return(GlobalOptions); }