packages/Windows API Code Pack 1.1/source/Samples/DirectX/CS/Direct2D/D2DShapes/D2DShapesControl.cs
/// <summary>
/// Adds the child shapes to tree.
/// </summary>
/// <param name="parent">The parent node.</param>
/// <param name="shapes">The list of shapes to add.</param>
/// <param name="point">The point at which child shapes should be checked.</param>
Adds the child shapes to tree.
Adds the child shapes to tree .
private static void AddChildShapesToTree(TreeNode parent, IList<DrawingShape> shapes, Point2F point)
        {
            for (int i = shapes.Count - 1; i >= 0; i--)
            {
                if (shapes[i].HitTest(point))
                {
                    var child = new TreeNode(shapes[i].ToString()) { Tag = shapes[i] };
                    child.Expand();
                    parent.Nodes.Add(child);
                    if (shapes[i].ChildShapes != null)
                        AddChildShapesToTree(child, shapes[i].ChildShapes, point);
                }
            }
        }
private static void AddChildShapesToTree ( TreeNode parent , IList < DrawingShape > shapes , Point2F point ) { for ( int i = shapes . Count - 1 ; i >= 0 ; i -- ) { if ( shapes [ i ] . HitTest ( point ) ) { var child = new TreeNode ( shapes [ i ] . ToString ( ) ) { Tag = shapes [ i ] } ; child . Expand ( ) ; parent . Nodes . Add ( child ) ; if ( shapes [ i ] . ChildShapes != null ) AddChildShapesToTree ( child , shapes [ i ] . ChildShapes , point ) ; } } }
Adds the child shapes to tree.
Adds the child shapes to tree .
parent
TreeNode
The parent node.
The parent node .
shapes
IList<DrawingShape>
The list of shapes to add.
The list of shapes to add .
point
Point2F
The point at which child shapes should be checked.
The point at which child shapes should be checked .