1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/External/Aga.Controls/Tree/TreeModelEventArgs.cs Sun May 27 15:16:19 2012 +0000
1.3 @@ -0,0 +1,50 @@
1.4 +using System;
1.5 +using System.Collections.Generic;
1.6 +using System.Text;
1.7 +
1.8 +namespace Aga.Controls.Tree
1.9 +{
1.10 + public class TreeModelEventArgs: TreePathEventArgs
1.11 + {
1.12 + private object[] _children;
1.13 + public object[] Children
1.14 + {
1.15 + get { return _children; }
1.16 + }
1.17 +
1.18 + private int[] _indices;
1.19 + public int[] Indices
1.20 + {
1.21 + get { return _indices; }
1.22 + }
1.23 +
1.24 + /// <summary>
1.25 + ///
1.26 + /// </summary>
1.27 + /// <param name="parent">Path to a parent node</param>
1.28 + /// <param name="children">Child nodes</param>
1.29 + public TreeModelEventArgs(TreePath parent, object[] children)
1.30 + : this(parent, null, children)
1.31 + {
1.32 + }
1.33 +
1.34 + /// <summary>
1.35 + ///
1.36 + /// </summary>
1.37 + /// <param name="parent">Path to a parent node</param>
1.38 + /// <param name="indices">Indices of children in parent nodes collection</param>
1.39 + /// <param name="children">Child nodes</param>
1.40 + public TreeModelEventArgs(TreePath parent, int[] indices, object[] children)
1.41 + : base(parent)
1.42 + {
1.43 + if (children == null)
1.44 + throw new ArgumentNullException();
1.45 +
1.46 + if (indices != null && indices.Length != children.Length)
1.47 + throw new ArgumentException("indices and children arrays must have the same length");
1.48 +
1.49 + _indices = indices;
1.50 + _children = children;
1.51 + }
1.52 + }
1.53 +}