BF2Statistics.MedalData.MedalDataEditor.UndoAllChangesMenuItem_Click C# (CSharp) Method

UndoAllChangesMenuItem_Click() private method

When the Undo Changes menu option is selected, this method reverts any changes made to the current condition list
private UndoAllChangesMenuItem_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void UndoAllChangesMenuItem_Click(object sender, EventArgs e)
        {
            // Make sure we have an award selected
            if (SelectedAwardNode == null || SelectedAwardNode.Parent == null)
            {
                MessageBox.Show("Please select an award!");
                return;
            }

            // Delay or tree redraw
            AwardConditionsTree.BeginUpdate();

            // Clear all Nodes
            AwardConditionsTree.Nodes.Clear();

            // Parse award conditions into tree view
            IAward SAward = AwardCache.GetAward(SelectedAwardNode.Name);
            SAward.UndoConditionChanges();
            AwardConditionsTree.Nodes.Add(SAward.ToTree());

            // Revalidate
            ValidateConditions(SelectedAwardNode, SAward.GetCondition());

            // Conditions tree's are to be expanded at all times
            AwardConditionsTree.ExpandAll();

            // Redraw the tree
            AwardConditionsTree.EndUpdate();
        }