private void btnOpen_Click(object sender, RoutedEventArgs e) { if (tbxFile.Text.Contains(Game.newGame.GameInfo.Gamer.Name)) { SerializationGameActions actions = new SerializationGameActions(); Game.newGame = actions.DeserializeObject(tbxFile.Text); Game.LoadGame(); } else { MessageBox.Show("ERROR!\nNot your save!"); } this.Close(); }
private void MenuItemFileSaveGame_Click(object sender, RoutedEventArgs e) { SerializationGameActions actions = new SerializationGameActions(); actions.SerializeObject(newGame.GameInfo.Gamer.Name.ToString() + ".xml", newGame); }