public void SaveException(string ex) { List <ExceptionDetails> exceptions = null; if (IsolatedStorageSettings.ApplicationSettings.Contains(UserSettingsModel.ExceptionKey)) { exceptions = (List <ExceptionDetails>)IsolatedStorageSettings.ApplicationSettings[UserSettingsModel.ExceptionKey]; } if (exceptions == null) { exceptions = new List <ExceptionDetails>(); } ExceptionDetails exception = new ExceptionDetails(); exception.ExceptionDate = DateTime.UtcNow; exception.ExceptionString = ex; exception.UserId = this.UserId; exceptions.Add(exception); IsolatedStorageSettings.ApplicationSettings[UserSettingsModel.ExceptionKey] = exceptions; lock (this) { IsolatedStorageSettings.ApplicationSettings.Save(); } }
public void SaveException(string ex) { List<ExceptionDetails> exceptions = null; if (IsolatedStorageSettings.ApplicationSettings.Contains(UserSettingsModel.ExceptionKey)) { exceptions = (List<ExceptionDetails>)IsolatedStorageSettings.ApplicationSettings[UserSettingsModel.ExceptionKey]; } if (exceptions == null) { exceptions = new List<ExceptionDetails>(); } ExceptionDetails exception = new ExceptionDetails(); exception.ExceptionDate = DateTime.UtcNow; exception.ExceptionString = ex; exception.UserId = this.UserId; exceptions.Add(exception); IsolatedStorageSettings.ApplicationSettings[UserSettingsModel.ExceptionKey] = exceptions; lock (this) { IsolatedStorageSettings.ApplicationSettings.Save(); } }