void PasteCmd()
        {
            SaveCurrentRule();
            if (clipboard_ == null)
            {
                return;
            }
            history_.Save();
            TreeNode c = IRule.CloneTreeNode(clipboard_);
            TreeNode s = RulesTreeView.SelectedNode;

            if (s == null)
            {
                RulesTreeView.Nodes.Add(c);
            }
            else
            {
                TreeNodeCollection col = this.GetOwningNodes(s);
                col.Insert(col.IndexOf(s), c);
            }
            RulesTreeView.SelectedNode = c;
            RulesTreeView.Select();
            RestoreSelectedRule();
            RulesTreeView.ExpandAll();
        }
Beispiel #2
0
        public void AddNewRule(List <IRule> rules)
        {
            RulesTreeView.Nodes.Clear();

            foreach (IRule r in rules)
            {
                AppendRule(r);
            }

            RulesTreeView.ExpandAll();
        }
Beispiel #3
0
        private void PasteCmd()
        {
            SaveCurrentRule();
            History.Save();

            AddNewRule(Deserialize(Clipboard.GetDataObject().GetData(typeof(string)).ToString()));

            RulesTreeView.Select();
            RestoreSelectedRule();
            RulesTreeView.ExpandAll();
        }