private void btnModify_Click(object sender, EventArgs e) { state = AddEditState.Edit; ucHeroList.Enabled = false; btnAdd.Enabled = false; btnDelete.Enabled = false; btnModify.Enabled = false; SelectedHeroChanged?.Invoke(selectedHero, selectedIndex, state); }
private void UcHeroList_SelectHeroChanged(MBHero selectedHero, int selectedIndex) { this.selectedHero = selectedHero; this.selectedIndex = selectedIndex; SelectedHeroChanged?.Invoke(selectedHero, selectedIndex, state); if (selectedHero != null) { btnDelete.Enabled = true; btnModify.Enabled = true; } }
private void btnAdd_Click(object sender, EventArgs e) { state = AddEditState.Add; ucHeroList.Enabled = false; btnAdd.Enabled = false; btnDelete.Enabled = false; btnModify.Enabled = false; MBHero hero = new MBHero(); SelectedHeroChanged?.Invoke(hero, -1, state); }