Example #1
0
        private void b_DeleteDefinitionGroup_Click(object sender, EventArgs e)
        {
            if (!(lb_DefinitionGroupsForSkill.SelectedItem is DefinitionGroup currentlySelectedDefinitionGroup))
            {
                return;
            }

            var result = Misc.AreYouSureDialogConfirmed("Are you sure you want to delete the DefinitionGroup " +
                                                        currentlySelectedDefinitionGroup.name +
                                                        " and all of it's definitions?");

            if (result)
            {
                selectedSkillDefinitionGroupsDisplayValues.Remove(currentlySelectedDefinitionGroup);
            }
        }
Example #2
0
        private void b_DeleteSkillFromDefinitionGroups_Click(object sender, EventArgs e)
        {
            if (!(lb_skillsWithDefinitionGroups.SelectedItem is ISnoPower currentlySelectedSkill))
            {
                return;
            }

            var result = Misc.AreYouSureDialogConfirmed(
                "Are you sure you want to delete all DefinitionGroups for skill " +
                currentlySelectedSkill.NameEnglish + "?");

            if (!result)
            {
                return;
            }

            skillsWithDefinitionGroupsDisplayValues.Remove(currentlySelectedSkill);
            SnoToDefinitionGroups.Remove(currentlySelectedSkill.Sno);
        }
Example #3
0
        private void b_DeleteDefinitionGroup_Click(object sender, EventArgs e)
        {
            if (!(lb_DefinitionGroupsForSkill.SelectedItem is DefinitionGroup currentlySelectedDefinitionGroup))
            {
                return;
            }

            var result = Misc.AreYouSureDialogConfirmed("Are you sure you want to delete the DefinitionGroup " +
                                                        currentlySelectedDefinitionGroup.name +
                                                        " and all of it's definitions?");

            if (!result)
            {
                return;
            }

            selectedSkillDefinitionGroupsDisplayValues.Remove(currentlySelectedDefinitionGroup);
            var parentDefinitionGroups = SnoToDefinitionGroups[currentlySelectedDefinitionGroup.sno];

            parentDefinitionGroups.definitionGroups.Remove(currentlySelectedDefinitionGroup);
            ConfigPersistence.DeleteDefinitionGroup(parentDefinitionGroups, currentlySelectedDefinitionGroup.name);
        }