Exemple #1
0
        void TreeViewAfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            var label = e.Label;

            if (label != null && AfterLabelEdit != null)
            {
                // Fire the event AFTER tree node editing took place. Weired behaviour otherwise.
                // See http://www.codeproject.com/KB/tree/CustomizedLabelEdit.aspx and comments
                var doItLater = new DoItLater(
                    delegate()
                {
                    var args = new VVVV.Core.Viewer.LabelEditEventArgs(e.Node.Tag, label);
                    AfterLabelEdit(this, args);

                    if (args.CancelEdit)
                    {
                        e.Node.BeginEdit();
                    }
                    else
                    {
                        FTreeView.SelectedNode = e.Node;
                    }
                });

                FTreeView.BeginInvoke(doItLater);
            }

            e.CancelEdit = true;
        }
Exemple #2
0
        void FTreeViewAfterSelect(object sender, TreeViewEventArgs e)
        {
            SelectedNode = e.Node;

            var doItLater = new DoItLater(() => OnSelectionChanged(CurrentSelection));

            FTreeView.BeginInvoke(doItLater);
        }