TreeNodeCollectionExtensionsAddDirectory(TreeNodeCollection, DirectoryInfo) Method
Given the specified directory, this function resolves its icon and
adds a new tree node to the end of the source
TreeNodeCollection collection.
This tree node contains the directory name and its icon as image index.
Namespace: DevCase.Extensions.TreeNodeCollectionExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static TreeNode AddDirectory(
this TreeNodeCollection nodes,
DirectoryInfo directory
)
<ExtensionAttribute>
Public Shared Function AddDirectory (
nodes As TreeNodeCollection,
directory As DirectoryInfo
) As TreeNode
Dim nodes As TreeNodeCollection
Dim directory As DirectoryInfo
Dim returnValue As TreeNode
returnValue = nodes.AddDirectory(directory)
public:
[ExtensionAttribute]
static TreeNode^ AddDirectory(
TreeNodeCollection^ nodes,
DirectoryInfo^ directory
)
[<ExtensionAttribute>]
static member AddDirectory :
nodes : TreeNodeCollection *
directory : DirectoryInfo -> TreeNode
No code example is currently available or this language may not be supported.
- nodes TreeNodeCollection
-
The source TreeNodeCollection.
- directory DirectoryInfo
-
The directory to add.
TreeNode
The resulting
TreeNode.
In Visual Basic and C#, you can call this method as an instance method on any object of type
TreeNodeCollection. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This is a code example.
No code example is currently available or this language may not be supported.
Me.TreeView1.ImageList = New ImageList With {.ImageSize = New Size(16, 16)}
Dim dir As New DirectoryInfo("C:\Windows\System32")
Me.TreeView1.Nodes.AddDirectory(dir)
Dim dirNodes As TreeNodeCollection = Me.TreeView1.Nodes(dir.FullName).Nodes
Me.TreeView1.BeginUpdate()
For Each fi As FileInfo In dir.EnumerateFiles()
dirNodes.AddFile(fi)
Next fi
Me.TreeView1.EndUpdate()
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.