Share via


IExplorerNodeCollection.AddFolder Method

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

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

Syntax

'Declaration
Function AddFolder ( _
    text As String, _
    folderIcon As Image, _
    createChildNodes As Action(Of IExplorerNode) _
) As IExplorerNode
IExplorerNode AddFolder(
    string text,
    Image folderIcon,
    Action<IExplorerNode> createChildNodes
)

Parameters

  • text
    Type: String

    The text to display with the new folder node.

  • folderIcon
    Type: Image

    The icon to display with the new folder node.

  • createChildNodes
    Type: Action<IExplorerNode>

    The delegate to execute to create child nodes for the new folder node. This delegate is executed automatically when the NodeChildrenRequested event for the new folder node is raised.

Return Value

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

Remarks

When you use the AddFolder method to create a folder node, you can pass an Action 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.

.NET Framework Security

See Also

Reference

IExplorerNodeCollection Interface

Microsoft.VisualStudio.SharePoint.Explorer Namespace