Exemplo n.º 1
0
 public void SelectNode(IRealTreeNode node, SelectNodeFlags flags)
 {
     if (node == null)
     {
         tree.SelectedNode = null;
         return;
     }
     tree.SelectedNode = (DATreeNode)node;
     if ((flags & SelectNodeFlags.Expand) != 0)
     {
         node.ExpandNode();
     }
     if ((flags & SelectNodeFlags.FocusTree) != 0)
     {
         tree.Focus();
         if (TreeBehaviour.InfluenceGlobalTrees)
         {
             HTree.CallFocusedNodeChanged();
         }
     }
     if ((flags & SelectNodeFlags.ScrollInView) != 0)
     {
         node.EnsureVisibleNode();
     }
 }
Exemplo n.º 2
0
 public static bool CheckedAllChildren(this IRealTreeNode node)
 {
     foreach (var child in node.RealChildren)
     {
         if (!child.NodeChecked)
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 3
0
 public override void NotifyExpanded()
 {
     if (m_conn.Settings != null && m_conn.Settings.Tree().AutoExpandTables)
     {
         IRealTreeNode child = RealNode.ChildByName("tables");
         if (child != null)
         {
             MainWindow.Instance.RunInMainWindow(child.ExpandNode);
         }
     }
 }
Exemplo n.º 4
0
 public IRealTreeNode FindNode(string path, bool allowPrepareChildren)
 {
     try
     {
         tree.BeginUpdate();
         using (var wc = new WaitContext())
         {
             string[] p = path.Split('/');
             if (p[0] != RootPath)
             {
                 return(null);
             }
             IRealTreeNode item = Root.RealNode;
             for (int i = 1; i < p.Length; i++)
             {
                 if (item == null)
                 {
                     return(null);
                 }
                 bool found = false;
                 if (allowPrepareChildren && !item.LogicalNode.PreparedChildren)
                 {
                     item.LogicalNode.GetChildrenNow();
                 }
                 item.RefreshChilds(false);
                 foreach (var rchild in item.RealChildren)
                 {
                     if (rchild.LogicalNode.Name == p[i] || rchild.LogicalNode.Name + ".con" == p[i])
                     {
                         item  = rchild;
                         found = true;
                         break;
                     }
                 }
                 if (!found)
                 {
                     return(null);
                 }
             }
             return(item);
         }
     }
     finally
     {
         tree.EndUpdate();
     }
 }
Exemplo n.º 5
0
 public NodeEventArgs(IRealTreeNode node)
 {
     RealNode = node;
 }