Inheritance: TreePathEventArgs
Exemplo n.º 1
0
 public void OnNodesChanged(TreeModelEventArgs args)
 {
     if (NodesChanged != null)
     {
         NodesChanged(this, args);
     }
 }
Exemplo n.º 2
0
 public void OnNodeRemoved(TreeModelEventArgs args)
 {
     if (NodesRemoved != null)
     {
         NodesRemoved(this, args);
     }
 }
Exemplo n.º 3
0
 public void OnNodeInserted(TreeModelEventArgs args)
 {
     if (NodesInserted != null)
     {
         NodesInserted(this, args);
     }
 }
Exemplo n.º 4
0
 private void ClearNodesSize(TreeModelEventArgs e, TreeNodeAdv parent)
 {
     if (e.Indices != null)
     {
         foreach (int index in e.Indices)
         {
             if (index >= 0 && index < parent.Nodes.Count)
             {
                 TreeNodeAdv node = parent.Nodes[index];
                 node.Height = node.RightBounds = null;
             }
             else
             {
                 throw new ArgumentOutOfRangeException("Index out of range");
             }
         }
     }
     else
     {
         foreach (TreeNodeAdv node in parent.Nodes)
         {
             foreach (object obj in e.Children)
             {
                 if (node.Tag == obj)
                 {
                     node.Height = node.RightBounds = null;
                 }
             }
         }
     }
 }
Exemplo n.º 5
0
 protected void OnNodesRemoved(TreeModelEventArgs args)
 {
     if (NodesRemoved != null)
     {
         NodesRemoved(this, args);
     }
 }
Exemplo n.º 6
0
 internal void OnNodeRemoved(Node parent, int index, Node node)
 {
     if (NodesRemoved != null)
     {
         TreeModelEventArgs args = new TreeModelEventArgs(GetPath(parent), new int[] { index }, new object[] { node });
         NodesRemoved(this, args);
     }
 }
Exemplo n.º 7
0
        protected void NotifyModel()
        {
            TreeModel model = FindModel();

            if (model != null && Parent != null)
            {
                TreePath path = model.GetPath(Parent);
                if (path != null)
                {
                    TreeModelEventArgs args = new TreeModelEventArgs(path, new int[] { Index }, new object[] { this });
                    model.OnNodesChanged(args);
                }
            }
        }
Exemplo n.º 8
0
        private void _model_NodesChanged(object sender, TreeModelEventArgs e)
        {
            TreeNodeAdv parent = FindNode(e.Path);

            if (parent != null && parent.IsVisible && parent.IsExpanded)
            {
                if (InvokeRequired)
                {
                    Invoke(new UpdateContentWidthDelegate(ClearNodesSize), e, parent);
                }
                else
                {
                    ClearNodesSize(e, parent);
                }
                SmartFullUpdate();
            }
        }
Exemplo n.º 9
0
        private void _model_NodesInserted(object sender, TreeModelEventArgs e)
        {
            if (e.Indices == null)
            {
                throw new ArgumentNullException("Indices");
            }

            TreeNodeAdv parent = FindNode(e.Path);

            if (parent != null)
            {
                for (int i = 0; i < e.Children.Length; i++)
                {
                    AddNewNode(parent, e.Children[i], e.Indices[i]);
                }
            }
            SmartFullUpdate();
        }
Exemplo n.º 10
0
        private void _model_NodesRemoved(object sender, TreeModelEventArgs e)
        {
            TreeNodeAdv parent = FindNode(e.Path);

            if (parent != null)
            {
                if (e.Indices != null)
                {
                    List <int> list = new List <int>(e.Indices);
                    list.Sort();
                    for (int n = list.Count - 1; n >= 0; n--)
                    {
                        int index = list[n];
                        if (index >= 0 && index <= parent.Nodes.Count)
                        {
                            parent.Nodes.RemoveAt(index);
                        }
                        else
                        {
                            throw new ArgumentOutOfRangeException("Index out of range");
                        }
                    }
                }
                else
                {
                    for (int i = parent.Nodes.Count - 1; i >= 0; i--)
                    {
                        for (int n = 0; n < e.Children.Length; n++)
                        {
                            if (parent.Nodes[i].Tag == e.Children[n])
                            {
                                parent.Nodes.RemoveAt(i);
                                break;
                            }
                        }
                    }
                }
            }
            UpdateSelection();
            SmartFullUpdate();
        }
Exemplo n.º 11
0
 protected void OnNodesRemoved(TreeModelEventArgs args)
 {
     if (NodesRemoved != null)
         NodesRemoved(this, args);
 }
Exemplo n.º 12
0
        private void _model_NodesInserted(object sender, TreeModelEventArgs e)
        {
            if (e.Indices == null)
                throw new ArgumentNullException("Indices");

            TreeNodeAdv parent = FindNode(e.Path);
            if (parent != null)
            {
                for (int i = 0; i < e.Children.Length; i++)
                    AddNewNode(parent, e.Children[i], e.Indices[i]);
            }
            SmartFullUpdate();
        }
Exemplo n.º 13
0
 public void OnNodeRemoved(TreeModelEventArgs args)
 {
     if (NodesRemoved != null)
         NodesRemoved(this, args);
 }
Exemplo n.º 14
0
 public void OnNodesChanged(TreeModelEventArgs args)
 {
     if (NodesChanged != null)
         NodesChanged(this, args);
 }
Exemplo n.º 15
0
 internal void OnNodeRemoved(Node parent, int index, Node node)
 {
     if (NodesRemoved != null)
     {
         TreeModelEventArgs args = new TreeModelEventArgs(GetPath(parent), new int[] { index }, new object[] { node });
         NodesRemoved(this, args);
     }
 }
Exemplo n.º 16
0
 public void OnNodeInserted(TreeModelEventArgs args)
 {
     if (NodesInserted != null)
         NodesInserted(this, args);
 }
Exemplo n.º 17
0
 void _innerModel_NodesRemoved(object sender, TreeModelEventArgs e)
 {
     OnStructureChanged(new TreePathEventArgs(e.Path));
 }
Exemplo n.º 18
0
 void _innerModel_NodesChanged(object sender, TreeModelEventArgs e)
 {
     OnStructureChanged(new TreePathEventArgs(e.Path));
 }
Exemplo n.º 19
0
 private void ClearNodesSize(TreeModelEventArgs e, TreeNodeAdv parent)
 {
     if (e.Indices != null)
     {
         foreach (int index in e.Indices)
         {
             if (index >= 0 && index < parent.Nodes.Count)
             {
                 TreeNodeAdv node = parent.Nodes[index];
                 node.Height = node.RightBounds = null;
             }
             else
                 throw new ArgumentOutOfRangeException("Index out of range");
         }
     }
     else
     {
         foreach (TreeNodeAdv node in parent.Nodes)
         {
             foreach (object obj in e.Children)
                 if (node.Tag == obj)
                 {
                     node.Height = node.RightBounds = null;
                 }
         }
     }
 }
Exemplo n.º 20
0
 private void _model_NodesRemoved(object sender, TreeModelEventArgs e)
 {
     TreeNodeAdv parent = FindNode(e.Path);
     if (parent != null)
     {
         if (e.Indices != null)
         {
             List<int> list = new List<int>(e.Indices);
             list.Sort();
             for (int n = list.Count - 1; n >= 0; n--)
             {
                 int index = list[n];
                 if (index >= 0 && index <= parent.Nodes.Count)
                     parent.Nodes.RemoveAt(index);
                 else
                     throw new ArgumentOutOfRangeException("Index out of range");
             }
         }
         else
         {
             for (int i = parent.Nodes.Count - 1; i >= 0; i--)
             {
                 for (int n = 0; n < e.Children.Length; n++)
                     if (parent.Nodes[i].Tag == e.Children[n])
                     {
                         parent.Nodes.RemoveAt(i);
                         break;
                     }
             }
         }
     }
     UpdateSelection();
     SmartFullUpdate();
 }
Exemplo n.º 21
0
 private void _model_NodesChanged(object sender, TreeModelEventArgs e)
 {
     TreeNodeAdv parent = FindNode(e.Path);
     if (parent != null && parent.IsVisible  && parent.IsExpanded)
     {
         if (InvokeRequired)
             Invoke(new UpdateContentWidthDelegate(ClearNodesSize), e, parent);
         else
             ClearNodesSize(e, parent);
         SmartFullUpdate();
     }
 }