BF2Statistics.MedalData.ConditionListForm.Initialize C# (CSharp) Method

Initialize() private method

Intializes the condition tree
private Initialize ( ) : void
return void
        private void Initialize()
        {
            // Add Conditions to tree view
            ConditionTree.BeginUpdate();
            ConditionTree.Nodes.Clear();
            ConditionTree.Nodes.Add(List.ToTree());
            ConditionTree.EndUpdate();
            ConditionTree.ExpandAll();

            // Get the list name
            ListTypeBox.Text = ConditionList.Names[(int)List.Type];

            // Proccess list descritpion
            if (List.Type == ConditionType.And || List.Type == ConditionType.Or)
            {
                ConditionDescBox.Text = "Can contain unlimited number of sub criteria's";
            }
            else
            {
                ConditionDescBox.Text = "Must contain ";
                ConditionDescBox.Text += (List.Type == ConditionType.Not)
                    ? "1 Sub Criteria."
                    : "2 Sub Criteria's. An optinal 3rd \"Value\" Criteria can be applied.";
            }

            // Hide value box's for unsupporting condition lists
            if (List.Type != ConditionType.Plus && List.Type != ConditionType.Div)
            {
                EnableValue.Visible = false;
                ValueBox.Visible = false;
            }
            else
            {
                // Get our condition value, and add its value to the valuebox
                List<Condition> CL = List.GetConditions();
                if (CL.Count == 3)
                {
                    EnableValue.Checked = true;
                    ValueBox.Value = Int32.Parse(CL[2].ToString());
                }
                else
                    EnableValue.Checked = false;
            }
        }