コード例 #1
0
 private void SelectAllFromStart(TreeNodeAdv node)
 {
     Tree.ClearSelection();
     int a = node.Row;
     int b = Tree.SelectionStart.Row;
     for (int i = Math.Min(a, b); i <= Math.Max(a, b); i++)
     {
         if (Tree.SelectionMode == TreeSelectionMode.Multi || Tree.RowMap[i].Parent == node.Parent)
             Tree.RowMap[i].IsSelected = true;
     }
 }
コード例 #2
0
 protected override void FocusRow(TreeNodeAdv node)
 {
     Tree.SuspendSelectionEvent = true;
     try
     {
         if (Tree.SelectionMode == TreeSelectionMode.Single || Tree.SelectionStart == null)
             base.FocusRow(node);
         else if (CanSelect(node))
         {
             SelectAllFromStart(node);
             Tree.CurrentNode = node;
             Tree.ScrollTo(node);
         }
     }
     finally
     {
         Tree.SuspendSelectionEvent = false;
     }
 }
コード例 #3
0
 public TreeViewAdvCancelEventArgs(TreeNodeAdv node)
     : base(node)
 {
 }
コード例 #4
0
 protected virtual void FocusRow(TreeNodeAdv node)
 {
     Tree.SuspendSelectionEvent = true;
     try
     {
         Tree.ClearSelection();
         Tree.CurrentNode = node;
         Tree.SelectionStart = node;
         node.IsSelected = true;
         Tree.ScrollTo(node);
     }
     finally
     {
         Tree.SuspendSelectionEvent = false;
     }
 }
コード例 #5
0
 protected bool CanSelect(TreeNodeAdv node)
 {
     if (Tree.SelectionMode == TreeSelectionMode.MultiSameParent)
     {
         return (Tree.SelectionStart == null || node.Parent == Tree.SelectionStart.Parent);
     }
     else
         return true;
 }
コード例 #6
0
 public TreeViewAdvEventArgs(TreeNodeAdv node)
 {
     _node = node;
 }