private void writeWorldBuildingsToIsolatedStorage(WorldBuilding v) { var settings1 = IsolatedStorageFile.GetUserStoreForApplication(); if (settings1.FileExists("WorldBuilding")) { settings1.DeleteFile("WorldBuilding"); } using (var fileStream = settings1.OpenFile("WorldBuilding", FileMode.Create)) { var serializer = new DataContractSerializer(typeof(WorldBuilding)); serializer.WriteObject(fileStream, v); } }
private void ReadWorldBuildingsFromIsolatedStorage() { var settings1 = IsolatedStorageFile.GetUserStoreForApplication(); if (settings1.FileExists("WorldBuilding")) { using (var fileStream = settings1.OpenFile("WorldBuilding", FileMode.Open)) { var serializer = new DataContractSerializer(typeof(WorldBuilding)); _worldbuildings = (WorldBuilding)serializer.ReadObject(fileStream); } } }