GenericFolderNode.Create Method (IExplorerNode, String, Action<IExplorerNode>)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Creates a new folder node as a child of the specified parent node, and uses the specified delegate to create child nodes for the new folder node.

Namespace:  Microsoft.VisualStudio.SharePoint.Explorer
Assembly:  Microsoft.VisualStudio.SharePoint.Utilities (in Microsoft.VisualStudio.SharePoint.Utilities.dll)

Syntax

'Declaration
Public Shared Function Create ( _
    parentNode As IExplorerNode, _
    text As String, _
    createChildNodes As Action(Of IExplorerNode) _
) As IExplorerNode
'Usage
Dim parentNode As IExplorerNode
Dim text As String
Dim createChildNodes As Action(Of IExplorerNode)
Dim returnValue As IExplorerNode

returnValue = GenericFolderNode.Create(parentNode, _
    text, createChildNodes)
public static IExplorerNode Create(
    IExplorerNode parentNode,
    string text,
    Action<IExplorerNode> createChildNodes
)

Parameters

Return Value

Type: Microsoft.VisualStudio.SharePoint.Explorer.IExplorerNode
The new folder node.

Remarks

When you use the Create(IExplorerNode, String, Action<IExplorerNode>) method to create a folder node, you can pass a an Action<T> delegate that will be called automatically to create the child nodes for the new folder node. The parameter of this delegate is a IExplorerNode object that represents the folder node to which you can add children. For a walkthrough that demonstrates how to specify a delegate when you create a folder node, see Walkthrough: Extending Server Explorer to Display Web Parts.

After you call the Create(IExplorerNode, String, Action<IExplorerNode>) method, Visual Studio adds the delegate to the Annotations property of the IExplorerNode that represents the new folder node. The delegate is stored as a key/value pair in the Annotations property, and the CreateChildNodesAnnotationKey value is the key. For more information about using the Annotations property, see Associating Custom Data with SharePoint Tools Extensions.

.NET Framework Security

See Also

Reference

GenericFolderNode Class

GenericFolderNode Members

Create Overload

Microsoft.VisualStudio.SharePoint.Explorer Namespace