本文整理匯總了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