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); } }
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); } } }