Ejemplo n.º 1
0
 private void writePoisByBuildingToIsolatedStorage(PoisByBuilding v, string directory)
 {
     var settings1 = IsolatedStorageFile.GetUserStoreForApplication();
     if (settings1.FileExists(directory + "/PoisByBuilding"))
     {
         settings1.DeleteFile(directory + "/PoisByBuilding");
     }
     else
     {
         settings1.CreateDirectory(directory);
     }
     using (var fileStream = settings1.OpenFile(directory + "/PoisByBuilding", FileMode.Create))
     {
         var serializer = new DataContractSerializer(typeof(PoisByBuilding));
         serializer.WriteObject(fileStream, v);
     }
 }
Ejemplo n.º 2
0
        private void ReadPoisByBuildingFromIsolatedStorage(string directory)
        {

            var settings1 = IsolatedStorageFile.GetUserStoreForApplication();
            if (settings1.FileExists(directory + "/PoisByBuilding"))
            {
                using (var fileStream = settings1.OpenFile(directory + "/PoisByBuilding", FileMode.Open))
                {
                    var serializer = new DataContractSerializer(typeof(PoisByBuilding));
                    _poisByBuilding = (PoisByBuilding)serializer.ReadObject(fileStream);
                }
            }
        }