/// <summary>
        /// Restores the condition / criteria back to default (vanilla)
        /// </summary>
        private void RestoreToDefaultMenuItem_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.RestoreDefaultConditions();
            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();
        }
        /// <summary>
        /// An event called everytime a new award is selected...
        /// It repaints the current award info
        /// </summary>
        private void AwardTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            // Set our award globally
            SelectedAwardNode = e.Node;

            // Only proccess child Nodes
            if (SelectedAwardNode.Nodes.Count == 0)
            {
                // Set Award Image
                SetAwardImage(SelectedAwardNode.Name);

                // Set award name and type
                switch (Award.GetType(SelectedAwardNode.Name))
                {
                case AwardType.Badge:
                    AwardTypeBox.Text = "Badge";
                    AwardNameBox.Text = Award.GetName(SelectedAwardNode.Name);
                    break;

                case AwardType.Medal:
                    AwardTypeBox.Text = "Medal";
                    AwardNameBox.Text = Award.GetName(SelectedAwardNode.Name);
                    break;

                case AwardType.Ribbon:
                    AwardTypeBox.Text = "Ribbon";
                    AwardNameBox.Text = Award.GetName(SelectedAwardNode.Name);
                    break;

                case AwardType.Rank:
                    AwardTypeBox.Text = "Rank";
                    AwardNameBox.Text = Rank.GetName(Int32.Parse(SelectedAwardNode.Name));
                    break;
                }

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

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

                // Parse award conditions into tree view
                SelectedAward = AwardCache.GetAward(SelectedAwardNode.Name);
                TreeNode Conds = SelectedAward.ToTree();
                if (Conds != null)
                {
                    AwardConditionsTree.Nodes.Add(Conds);
                }

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

                // Redraw the tree
                AwardConditionsTree.EndUpdate();
            }
        }
        /// <summary>
        /// Adds a new criteria to an award from the Add Critera Dialog
        /// </summary>
        private void AddNewCriteria(object sender, FormClosingEventArgs e)
        {
            // If there is a node referenced.
            if (ConditionNode != null && ConditionNode.Tag is ConditionList)
            {
                Condition     Add  = Child.GetCondition();
                ConditionList List = (ConditionList)ConditionNode.Tag;
                List.Add(Add);
            }
            else
            {
                // No Node referenced... Use top most
                ConditionList A = new ConditionList(ConditionType.And);
                Condition     B = SelectedAward.GetCondition();
                if (B is ConditionList)
                {
                    ConditionList C = (ConditionList)B;
                    if (C.Type == ConditionType.And)
                    {
                        A = C;
                    }
                    else
                    {
                        A.Add(B);
                    }
                }
                else
                {
                    // Add existing conditions into the condition list
                    A.Add(B);
                }

                // Add the new condition
                A.Add(Child.GetCondition());

                // Parse award conditions into tree view
                SelectedAward.SetCondition(A);
            }

            // Update the tree view
            AwardConditionsTree.BeginUpdate();
            AwardConditionsTree.Nodes.Clear();
            AwardConditionsTree.Nodes.Add(SelectedAward.ToTree());
            ValidateConditions(SelectedAwardNode, SelectedAward.GetCondition());
            AwardConditionsTree.ExpandAll();
            AwardConditionsTree.EndUpdate();
        }
        /// <summary>
        /// Removes a criteria from the selected awards condition tree
        /// </summary>
        public void DeleteCriteria()
        {
            // Make sure we have a node selected
            if (ConditionNode == null)
            {
                MessageBox.Show("Please select a criteria to remove.");
                return;
            }

            // Dont update tree till we are finished adding/removing
            AwardConditionsTree.BeginUpdate();

            if (ConditionNode.Parent == null)
            {
                AwardConditionsTree.Nodes.Remove(ConditionNode);
                ValidateConditions(SelectedAwardNode, SelectedAward.GetCondition());
            }

            // Dont delete on Plus / Div Trees
            else if (!(ConditionNode.Tag is ConditionList))
            {
                TreeNode      Parent = ConditionNode.Parent;
                ConditionList C      = (ConditionList)Parent.Tag;

                // Remove Not Conditions, as they only hold 1 criteria anyways
                if (C.Type == ConditionType.Not)
                {
                    AwardConditionsTree.Nodes.Remove(Parent);
                }

                // Dont remove Plus or Div elements as they need 2 or 3 to work!
                else if (C.Type == ConditionType.Plus || C.Type == ConditionType.Div)
                {
                    ConditionNode = Parent;
                    AwardConditionsTree.SelectedNode = Parent;
                    EditCriteria();
                }
                else
                {
                    // Remove Node
                    AwardConditionsTree.Nodes.Remove(ConditionNode);

                    // remove empty parent nodes
                    if (Parent.Nodes.Count == 0)
                    {
                        AwardConditionsTree.Nodes.Remove(Parent);
                    }
                }
            }
            else
            {
                AwardConditionsTree.Nodes.Remove(ConditionNode);
            }

            // Get our selected medal condition
            Condition Cond = null;

            // Set awards new conditions
            if (AwardConditionsTree.Nodes.Count > 0)
            {
                Cond = MedalDataParser.ParseNodeConditions(AwardConditionsTree.Nodes[0]);
                SelectedAward.SetCondition(Cond);
            }
            else
            {
                SelectedAward.SetCondition(null);
            }

            // Reparse conditions
            AwardConditionsTree.Nodes.Clear();
            TreeNode NN = SelectedAward.ToTree();

            if (NN != null)
            {
                AwardConditionsTree.Nodes.Add(NN);
            }

            ValidateConditions(SelectedAwardNode, Cond);
            AwardConditionsTree.EndUpdate();
            AwardConditionsTree.ExpandAll();
        }
        /// <summary>
        /// Brings up the Criteria Editor for the selected Award Condition Node
        /// </summary>
        public void EditCriteria()
        {
            // Make sure we have a node selected
            if (ConditionNode == null)
            {
                MessageBox.Show("Please select a criteria to edit.");
                return;
            }

            // Make sure its a child node
            if (ConditionNode.Parent == null && ConditionNode.Nodes.Count != 0)
            {
                return;
            }

            // Open correct condition editor form
            if (ConditionNode.Tag is ObjectStat)
            {
                Child = new ObjectStatForm(ConditionNode);
            }
            else if (ConditionNode.Tag is PlayerStat)
            {
                Child = new ScoreStatForm(ConditionNode);
            }
            else if (ConditionNode.Tag is MedalOrRankCondition)
            {
                Child = new MedalConditionForm(ConditionNode);
            }
            else if (ConditionNode.Tag is GlobalStatMultTimes)
            {
                Child = new GlobalStatMultTimesForm(ConditionNode);
            }
            else if (ConditionNode.Tag is ConditionList)
            {
                Child = new ConditionListForm(ConditionNode);
            }
            else
            {
                return;
            }

            if (Child.ShowDialog() == DialogResult.OK)
            {
                // Delay tree redraw
                AwardConditionsTree.BeginUpdate();

                // Set awards new conditions from the tree node tagged conditions
                SelectedAward.SetCondition(MedalDataParser.ParseNodeConditions(AwardConditionsTree.Nodes[0]));

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

                // Reparse conditions
                AwardConditionsTree.Nodes.Add(SelectedAward.ToTree());

                // Validation highlighting
                ValidateConditions(SelectedAwardNode, SelectedAward.GetCondition());

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