private void RuleLayout_DragDrop(object sender, DragEventArgs e) { RuleButton button = (RuleButton)e.Data.GetData(typeof(RuleButton)); FlowLayoutPanel destination = (FlowLayoutPanel)sender; Point target_spot = destination.PointToClient(new Point(e.X, e.Y)); int target_index = destination.Controls.GetChildIndex(destination.GetChildAtPoint(target_spot)); destination.Controls.SetChildIndex(button, target_index); destination.Refresh(); }
public void DeleteRuleButton(RuleButton rule_button) { Secretary.DeleteRule(Secretary.GetRule(rule_button.GetRuleName())); RuleLayout.Controls.Remove(rule_button); }
public void RemoveRuleButton(RuleButton rule_button) { Secretary.RemoveRuleFromProfile(rule_button.GetRuleName()); RuleLayout.Controls.Remove(rule_button); }