/// <summary> /// Gets the current applications <PlaneDisaster> section. /// </summary> /// <param name="ConfigLevel"> /// The <ConfigurationUserLevel> that the config file /// is retrieved from. /// </param> /// <returns> /// The configuration file's <PlaneDisaster> section. /// </returns> public static PlaneDisasterSettings GetSection(ConfigurationUserLevel ConfigLevel) { /* * This class is setup using a factory pattern that forces you to * name the section <PlaneDisaster> in the config file. * If you would prefer to be able to specify the name of the section, * then remove this method and mark the constructor public. */ System.Configuration.Configuration Config = ConfigurationManager.OpenExeConfiguration (ConfigLevel); PlaneDisasterSettings oPlaneDisasterSettings; oPlaneDisasterSettings = (PlaneDisasterSettings)Config.GetSection("PlaneDisasterSettings"); if (oPlaneDisasterSettings == null) { oPlaneDisasterSettings = new PlaneDisasterSettings(); Config.Sections.Add("PlaneDisasterSettings", oPlaneDisasterSettings); } oPlaneDisasterSettings._Config = Config; return(oPlaneDisasterSettings); }
/// <summary> /// Gets the current applications <PlaneDisaster> section. /// </summary> /// <param name="ConfigLevel"> /// The <ConfigurationUserLevel> that the config file /// is retrieved from. /// </param> /// <returns> /// The configuration file's <PlaneDisaster> section. /// </returns> public static PlaneDisasterSettings GetSection(ConfigurationUserLevel ConfigLevel) { /* * This class is setup using a factory pattern that forces you to * name the section <PlaneDisaster> in the config file. * If you would prefer to be able to specify the name of the section, * then remove this method and mark the constructor public. */ System.Configuration.Configuration Config = ConfigurationManager.OpenExeConfiguration (ConfigLevel); PlaneDisasterSettings oPlaneDisasterSettings; oPlaneDisasterSettings = (PlaneDisasterSettings)Config.GetSection("PlaneDisasterSettings"); if (oPlaneDisasterSettings == null) { oPlaneDisasterSettings = new PlaneDisasterSettings(); Config.Sections.Add("PlaneDisasterSettings", oPlaneDisasterSettings); } oPlaneDisasterSettings._Config = Config; return oPlaneDisasterSettings; }
/// <summary> /// Default constructor. /// </summary> internal MainForm() { InitializeComponent(); /* ListBox Right Click event handlers */ lstProcedures.MouseDown += new MouseEventHandler(this.Lst_RightClickSelect); lstTables.MouseDown += new MouseEventHandler(this.Lst_RightClickSelect); lstViews.MouseDown += new MouseEventHandler(this.Lst_RightClickSelect); gridResults.DataError += new DataGridViewDataErrorEventHandler(this.EvtDataGridError); _oPlaneDisasterSettings = PlaneDisasterSettings.GetSection(ConfigurationUserLevel.PerUserRoamingAndLocal); _oPlaneDisasterSettings.RecentFiles.GenerateOpenRecentMenu (openRecentToolStripMenuItem, menuOpenRecent_Click); }