本文整理汇总了VB.NET中System.Web.UI.IHierarchyData.GetParent方法的典型用法代码示例。如果您正苦于以下问题:VB.NET IHierarchyData.GetParent方法的具体用法?VB.NET IHierarchyData.GetParent怎么用?VB.NET IHierarchyData.GetParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.IHierarchyData
的用法示例。
在下文中一共展示了IHierarchyData.GetParent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: GetChildren
Public Overridable Function GetChildren() _
As IHierarchicalEnumerable _
Implements IHierarchyData.GetChildren
Dim children As New FileSystemHierarchicalEnumerable()
If GetType(DirectoryInfo) Is fileSystemObject.GetType() Then
Dim temp As DirectoryInfo = _
CType(fileSystemObject, DirectoryInfo)
Dim fsi As FileSystemInfo
For Each fsi In temp.GetFileSystemInfos()
children.Add(New FileSystemHierarchyData(fsi))
Next fsi
End If
Return children
End Function 'GetChildren
Public Overridable Function GetParent() As IHierarchyData _
Implements IHierarchyData.GetParent
Dim parentContainer As New FileSystemHierarchicalEnumerable()
If GetType(DirectoryInfo) Is fileSystemObject.GetType() Then
Dim temp As DirectoryInfo = _
CType(fileSystemObject, DirectoryInfo)
Return New FileSystemHierarchyData(temp.Parent)
ElseIf GetType(FileInfo) Is fileSystemObject.GetType() Then
Dim temp As FileInfo = CType(fileSystemObject, FileInfo)
Return New FileSystemHierarchyData(temp.Directory)
End If
' If FileSystemObj is any other kind of FileSystemInfo, ignore it.
Return Nothing
End Function 'GetParent
End Class