private void b_save_Click(object sender, EventArgs e) { if (_characterUnit != null) { if (MessageBox.Show("Are you sure you want to save these changes?", "Warning!", MessageBoxButtons.YesNo) == DialogResult.Yes) { UnitHelpFunctions.SaveCharacterFile(_characterUnit, _characterPath); MessageBox.Show("Saving successful!"); } SetCharacterStatus(CharacterStatus, CharacterStatus.Saved, p_status, l_status); } }
private void b_save_Click(object sender, EventArgs e) { if (_backupCharacters) { CreateBackup(_characterPath1); CreateBackup(_characterPath2); } if (_characterUnit1 != null && _characterUnit2 != null) { if (MessageBox.Show("Are you sure you want to save these changes?", "Warning!", MessageBoxButtons.YesNo) == DialogResult.Yes) { //XmlUtilities<Unit>.Serialize(_characterUnit2.HeroUnit, @"F:\after.xml"); UnitHelpFunctions.SaveCharacterFile(_characterUnit1.BaseCharacter.Character, _characterPath1); UnitHelpFunctions.SaveCharacterFile(_characterUnit2.BaseCharacter.Character, _characterPath2); MessageBox.Show("Saving successful!"); } EnableComboBoxes(true, true); SetCharacterStatus(_characterStatus1, CharacterStatus.Saved, p_status1, l_status1); SetCharacterStatus(_characterStatus2, CharacterStatus.Saved, p_status2, l_status2); } }