/// <summary> /// Creates a settings object having default values /// </summary> /// <returns></returns> public static Settings_Permanent GetDefaultSettings() { Settings_Permanent settings = new Settings_Permanent(); InitializeDefaultSettings(settings); return(settings); }
private static void InitializeDefaultSettings(Settings_Permanent settings) { settings.UsersInfoToUpload = "NoInfo"; settings.UploadAttemptsCount = 0; settings.RegistrationComplete = false; settings.ObiVersionWhileSendingUserInfo = ""; }
/// <summary> /// Read the settings from the settings file; missing values are replaced with defaults. /// </summary> /// <remarks>Errors are silently ignored and default settings are returned.</remarks> public static Settings_Permanent GetSettings() { Settings_Permanent settings = new Settings_Permanent(); InitializeDefaultSettings(settings); //IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForDomain(); try { FileStream stream = new FileStream(GetSettingFilePath(), FileMode.Open, FileAccess.Read); SoapFormatter soap = new SoapFormatter(); settings = (Settings_Permanent)soap.Deserialize(stream); stream.Close(); } catch (Exception) { } return(settings); }