Esempio n. 1
0
 private void EndUpdateCTreeView()
 {
     if (OwnerCTreeView != null)
     {
         OwnerCTreeView.EndUpdate();
     }
 }
Esempio n. 2
0
 private void BeginUpdateCTreeView()
 {
     if (OwnerCTreeView != null)
     {
         OwnerCTreeView.BeginUpdate();
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Raises the SelectNode event.
 /// </summary>
 /// <param name="e">A CTreeViewEventArgs that contains the event data</param>
 protected internal virtual void OnSelectNode(CTreeViewEventArgs e)
 {
     //ParentCTreeView.Invalidate();
     //ParentCTreeView.Update();
     OwnerCTreeView.Refresh();
     if (SelectNode != null)
     {
         SelectNode(this, e);
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Expands the tree node.
 /// </summary>
 public void Expand()
 {
     IsExpanded = true;
     //if (Visible) foreach (CTreeNode child in Nodes) child.Visible = true;
     //Nodes.TraverseNodes(node => node.ParentNode.IsExpanded, node => { node.IsShown = true; });
     if (OwnerCTreeView != null)
     {
         OwnerCTreeView.OnExpandNode(new CTreeViewEventArgs(this));
     }
 }
Esempio n. 5
0
 /// <summary>
 /// Collapses the tree node.
 /// </summary>
 public void Collapse()
 {
     IsExpanded = false;
     //foreach (CTreeNode child in Nodes) child.Visible = false;
     //Nodes.TraverseNodes(node => node.IsShown, node => { node.IsShown = false; });
     if (OwnerCTreeView != null)
     {
         OwnerCTreeView.OnCollapseNode(new CTreeViewEventArgs(this));
     }
 }
Esempio n. 6
0
 /// <summary>
 ///
 /// </summary>
 public void Drag()
 {
     if (OwnerCTreeView.DragAndDropMode != CTreeViewDragAndDropMode.Nothing && IsSelected)
     {
         //Checking that all selected nodes has same parent
         bool checkSameParent = true;
         foreach (CTreeNode selectedNode in OwnerCTreeView.SelectedNodes)
         {
             if (selectedNode.ParentNode != OwnerCTreeView.SelectedNodes[0].ParentNode)
             {
                 checkSameParent = false;
             }
         }
         //Prepare and sort the dragged nodes
         if (checkSameParent)
         {
             List <CTreeNode> draggedNodes = new List <CTreeNode>(OwnerCTreeView.SelectedNodes);
             draggedNodes.Sort((node1, node2) => node1.Index - node2.Index);
             OwnerCTreeView.DoDragDrop(draggedNodes, DragDropEffects.All);
         }
     }
 }