internal void DeleteCondition(object sender, DeleteConditionEventArgs e)
        {
            SuspendLayout();
            ConditionControlBase controlToDelete = sender as ConditionControlBase;
            ConditionControlBase parentControl = controlToDelete.ParentConditionControl;

            Point center = controlToDelete.Center;

            DeleteControlSubtree(controlToDelete);
            ConditionControlBase newControl = GetControlForCondition(null, parentControl);

            if (parentControl != null)
            {
                int index = parentControl.SubconditionControls.IndexOf(controlToDelete);
                parentControl.SubconditionControls.Remove(controlToDelete);
                parentControl.SubconditionControls.Insert(index, newControl);
            }

            if (rootConditionControl == controlToDelete) rootConditionControl = newControl;

            newControl.Center = center;
            newControl.Focus();
            ResumeLayout();
            Invalidate();
        }
Example #2
0
 protected virtual void OnDeleteCondition(DeleteConditionEventArgs e)
 {
     if (DeleteCondition != null)
     {
         DeleteCondition(this, e);
     }
 }
Example #3
0
        internal void DeleteCondition(object sender, DeleteConditionEventArgs e)
        {
            SuspendLayout();
            ConditionControlBase controlToDelete = sender as ConditionControlBase;
            ConditionControlBase parentControl   = controlToDelete.ParentConditionControl;

            Point center = controlToDelete.Center;

            DeleteControlSubtree(controlToDelete);
            ConditionControlBase newControl = GetControlForCondition(null, parentControl);

            if (parentControl != null)
            {
                int index = parentControl.SubconditionControls.IndexOf(controlToDelete);
                parentControl.SubconditionControls.Remove(controlToDelete);
                parentControl.SubconditionControls.Insert(index, newControl);
            }

            if (rootConditionControl == controlToDelete)
            {
                rootConditionControl = newControl;
            }

            newControl.Center = center;
            newControl.Focus();
            ResumeLayout();
            Invalidate();
        }
 protected virtual void OnDeleteCondition(DeleteConditionEventArgs e)
 {
     if (DeleteCondition != null)
         DeleteCondition(this, e);
 }