IHierarchyData.Path 属性
定义
获取节点的分层路径。Gets the hierarchical path of the node.
public:
property System::String ^ Path { System::String ^ get(); };
public string Path { get; }
member this.Path : string
Public ReadOnly Property Path As String
属性值
一个 String,标识相对当前节点的分层路径。A String that identifies the hierarchical path relative to the current node.
示例
下面的代码示例演示如何 Path 在实现接口的类中实现属性 IHierarchyData 。The following code example demonstrates how to implement the Path property in a class that implements the IHierarchyData interface. FileSystemHierarchyData类包装 FileSystemInfo 对象, Path 属性实现返回其文件系统路径。The FileSystemHierarchyData class wraps a FileSystemInfo object, and the Path property implementation returns its file system path. 此代码示例摘自为接口和类提供的更大示例的一部分 IHierarchyData HierarchicalDataSourceControl 。This code example is part of a larger example provided for the IHierarchyData interface and the HierarchicalDataSourceControl class.
// 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 。The Path property can be passed to the GetHierarchicalView method to retrieve the HierarchicalDataSourceView object that corresponds to the node identified by Path.
注意
Path属性不应包含有关主机环境的任何敏感信息,因为它可能会在数据绑定控件中呈现给客户端。The Path property should not contain any sensitive information about the host environment, because it might be rendered to the client in a data-bound control.