public static void ReadMenu(Reader reader, Object menu) { if (reader.ReadPossible) { reader.Serializer = new XmlSerializer(typeof(Menu)); menu = (Menu)reader.Serializer.Deserialize(reader.sr); reader.sr.Close(); } }
private void Load(IAsyncResult ar) { Reader reader = new Reader(storageDevice.EndOpenContainer(ar)); if (reader.storageContainer != null && reader.storageContainer.FileExists(pendingOperations[0].Filename)) { reader.sr = new StreamReader(reader.storageContainer.OpenFile(pendingOperations[0].Filename, FileMode.Open, FileAccess.Read)); reader.ReadPossible = true; } pendingOperations[0].ReadMethod(reader, pendingOperations[0].Object); pendingOperations.RemoveAt(0); NextOperation(); }