Example #1
0
 public bool Persist()
 {
     using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
     {
         using (var fs = new IsolatedStorageFileStream(Common.ChronometerStore, FileMode.Create, isf))
         {
             DataContractJSONSerializationHelper.Serialize(fs, this);
             return(true);
         }
     }
     return(false);
 }
Example #2
0
 public bool Persist()
 {
     try
     {
         using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
         {
             using (var fs = new IsolatedStorageFileStream(Common.IntervalBlockStore, FileMode.Create, isf))
             {
                 DataContractJSONSerializationHelper.Serialize(fs, this);
                 return(true);
             }
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }