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); } }
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; } } }
protected virtual void MouseDownAtEmptySpace(TreeNodeAdvMouseEventArgs args) { Tree.ClearSelection(); }
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; } }
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; }
public override void MouseUp(TreeNodeAdvMouseEventArgs args) { FinishResize(); }
public override void MouseDown(TreeNodeAdvMouseEventArgs args) { }
protected override void MouseDownAtEmptySpace(TreeNodeAdvMouseEventArgs args) { }
public abstract void MouseUp(TreeNodeAdvMouseEventArgs args);