private void OnStartup_CheckedChanged(object sender, System.EventArgs e) { if (rbShow.Checked) { StartupMode = enumStartupMode.ShowDialog; } else if (rbSelected.Checked) { StartupMode = enumStartupMode.UseSavedCulture; } else if (rbDefault.Checked) { StartupMode = enumStartupMode.UseDefaultCulture; } }
//---------------------------------------------- //Private Methods //---------------------------------------------- // // SaveSettings and LoadSettings use an XML file, saved in so called // Isolated Storage. // // I'm not convinced that this is really the best way or the best place // to store this information, but it's certainly a .NET way to do it. // private void LoadSettings() { // Set the defaults StartupMode = enumStartupMode.ShowDialog; SelectedCulture = Thread.CurrentThread.CurrentUICulture; // Create an IsolatedStorageFile object and get the store // for this application. IsolatedStorageFile isoStorage = IsolatedStorageFile.GetUserStoreForDomain(); // Check whether the file exists if (isoStorage.GetFileNames("CultureSettings.xml").Length > 0) //MLHIDE { // Create isoStorage StreamReader. StreamReader stmReader = new StreamReader (new IsolatedStorageFileStream ("CultureSettings.xml", FileMode.Open, isoStorage)); //MLHIDE XmlTextReader xmlReader = new XmlTextReader(stmReader); // Loop through the XML file until all Nodes have been read and processed. while (xmlReader.Read()) { switch (xmlReader.Name) { case "StartupMode": //MLHIDE StartupMode = (enumStartupMode)int.Parse(xmlReader.ReadString()); break; case "Culture": //MLHIDE String CultName = xmlReader.ReadString(); CultureInfo CultInfo = new CultureInfo(CultName); SelectedCulture = CultInfo; break; } } // Close the reader xmlReader.Close(); stmReader.Close(); } isoStorage.Close(); }
private void OnStartup_CheckedChanged(object sender, System.EventArgs e) { if (rbShow.Checked) StartupMode = enumStartupMode.ShowDialog; else if (rbSelected.Checked) StartupMode = enumStartupMode.UseSavedCulture; else if (rbDefault.Checked) StartupMode = enumStartupMode.UseDefaultCulture; }