コード例 #1
0
ファイル: UserSettingsModel.cs プロジェクト: nrag/yapper
        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();
            }
        }
コード例 #2
0
ファイル: UserSettingsModel.cs プロジェクト: nrag/yapper
        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();
            }
        }