private void NewCriteria_Click(object sender, EventArgs e)
{
if (List.Type == ConditionType.Plus || List.Type == ConditionType.Div)
{
if (ConditionTree.Nodes[0].Nodes.Count > 1)
{
MessageBox.Show("Only 2 criteria's allowed per List.");
return;
}
}
else if (List.Type == ConditionType.Not)
{
if (ConditionTree.Nodes[0].Nodes.Count == 2)
{
MessageBox.Show("Only 1 criteria allowed per List.");
return;
}
}
// Make sure we are only adding to the root condition list
Child = new NewCriteriaForm();
Child.FormClosing += Child_FormClosing;
Child.Show();
}