共用方式為


IHierarchyData.Path 屬性

定義

取得節點的階層路徑。

public:
 property System::String ^ Path { System::String ^ get(); };
public string Path { get; }
member this.Path : string
Public ReadOnly Property Path As String

屬性值

A String 用來識別相對於當前節點的階層路徑。

範例

以下程式碼範例示範如何在實作IHierarchyData介面的類別中實作該Path屬性。 類別 FileSystemHierarchyData 會包裹物件, FileSystemInfo 屬性實作則 Path 回傳其檔案系統路徑。 此程式碼範例是為介面與HierarchicalDataSourceControl類別提供IHierarchyData較大範例的一部分。

// DirectoryInfo returns the OriginalPath, while FileInfo returns
// a fully qualified path.
public string Path
{
    get
    {
        return fileSystemObject.ToString();
    }
}
' DirectoryInfo returns the OriginalPath, while FileInfo returns
' a fully qualified path.

Public Overridable ReadOnly Property Path() As String _
 Implements IHierarchyData.Path
    Get
        Return fileSystemObject.ToString()
    End Get
End Property

備註

Path此特性可傳入GetHierarchicalView方法,以擷取HierarchicalDataSourceView對應於由 所Path識別節點的物件。

謹慎

Path 屬性不應包含任何關於主機環境的敏感資訊,因為這些資訊可能會以資料綁定控制方式呈現給用戶端。

適用於

另請參閱