Пример #1
0
        public override void MouseDown(TreeNodeAdvMouseEventArgs args)
        {
            if (args.Node != null)
            {
                Tree.ItemDragMode = true;
                Tree.ItemDragStart = args.ViewLocation;

                if (args.Button == MouseButtons.Left || args.Button == MouseButtons.Right)
                {
                    Tree.BeginUpdate();
                    try
                    {
                        Tree.CurrentNode = args.Node;
                        if (args.Node.IsSelected)
                            _mouseDownFlag = true;
                        else
                        {
                            _mouseDownFlag = false;
                            DoMouseOperation(args);
                        }
                    }
                    finally
                    {
                        Tree.EndUpdate();
                    }
                }

            }
            else
            {
                Tree.ItemDragMode = false;
                MouseDownAtEmptySpace(args);
            }
        }
Пример #2
0
 protected override void DoMouseOperation(TreeNodeAdvMouseEventArgs args)
 {
     if (Tree.SelectionMode == TreeSelectionMode.Single || Tree.SelectionStart == null)
     {
         base.DoMouseOperation(args);
     }
     else if (CanSelect(args.Node))
     {
         Tree.SuspendSelectionEvent = true;
         try
         {
             SelectAllFromStart(args.Node);
         }
         finally
         {
             Tree.SuspendSelectionEvent = false;
         }
     }
 }
Пример #3
0
 protected virtual void MouseDownAtEmptySpace(TreeNodeAdvMouseEventArgs args)
 {
     Tree.ClearSelection();
 }
Пример #4
0
 protected virtual void DoMouseOperation(TreeNodeAdvMouseEventArgs args)
 {
     Tree.SuspendSelectionEvent = true;
     try
     {
         Tree.ClearSelection();
         if (args.Node != null)
             args.Node.IsSelected = true;
         Tree.SelectionStart = args.Node;
     }
     finally
     {
         Tree.SuspendSelectionEvent = false;
     }
 }
Пример #5
0
 public override void MouseUp(TreeNodeAdvMouseEventArgs args)
 {
     Tree.ItemDragMode = false;
     if (_mouseDownFlag)
     {
         if (args.Button == MouseButtons.Left)
             DoMouseOperation(args);
         else if (args.Button == MouseButtons.Right)
             Tree.CurrentNode = args.Node;
     }
     _mouseDownFlag = false;
 }
Пример #6
0
 public override void MouseUp(TreeNodeAdvMouseEventArgs args)
 {
     FinishResize();
 }
Пример #7
0
 public override void MouseDown(TreeNodeAdvMouseEventArgs args)
 {
 }
Пример #8
0
 protected override void MouseDownAtEmptySpace(TreeNodeAdvMouseEventArgs args)
 {
 }
Пример #9
0
 public abstract void MouseUp(TreeNodeAdvMouseEventArgs args);