TreeNodeCollectionExtensionsAddFile(TreeNodeCollection, FileInfo) Method
Given the specified file, this function resolves its icon and
adds a new tree node to the end of the source
TreeNodeCollection collection.
This tree node contains the file 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 AddFile(
this TreeNodeCollection nodes,
FileInfo file
)
<ExtensionAttribute>
Public Shared Function AddFile (
nodes As TreeNodeCollection,
file As FileInfo
) As TreeNode
Dim nodes As TreeNodeCollection
Dim file As FileInfo
Dim returnValue As TreeNode
returnValue = nodes.AddFile(file)
public:
[ExtensionAttribute]
static TreeNode^ AddFile(
TreeNodeCollection^ nodes,
FileInfo^ file
)
[<ExtensionAttribute>]
static member AddFile :
nodes : TreeNodeCollection *
file : FileInfo -> TreeNode
No code example is currently available or this language may not be supported.
- nodes TreeNodeCollection
-
The source TreeNodeCollection.
- file FileInfo
-
The file 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.