次の方法で共有


IHierarchyData.Path プロパティ

定義

ノードの階層パスを取得します。

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

プロパティ値

現在のノードに対する階層パスを識別する String

次のコード例では、IHierarchyData インターフェイスを実装するクラスに Path プロパティを実装する方法を示します。 FileSystemHierarchyData クラスはFileSystemInfo オブジェクトをラップし、Path プロパティの実装はファイル システム パスを返します。 このコード例は、 IHierarchyData インターフェイスと HierarchicalDataSourceControl クラスに提供されるより大きな例の一部です。

// 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 メソッドに渡して、Pathによって識別されるノードに対応するHierarchicalDataSourceView オブジェクトを取得できます。

注意事項

Path プロパティは、データ バインド コントロール内のクライアントにレンダリングされる可能性があるため、ホスト環境に関する機密情報を含めないようにする必要があります。

適用対象

こちらもご覧ください