ITypedList.GetListName(PropertyDescriptor[]) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回列表名称。
public:
System::String ^ GetListName(cli::array <System::ComponentModel::PropertyDescriptor ^> ^ listAccessors);
public string GetListName (System.ComponentModel.PropertyDescriptor[] listAccessors);
public string GetListName (System.ComponentModel.PropertyDescriptor[]? listAccessors);
abstract member GetListName : System.ComponentModel.PropertyDescriptor[] -> string
Public Function GetListName (listAccessors As PropertyDescriptor()) As String
参数
- listAccessors
- PropertyDescriptor[]
为其返回列表名称的 PropertyDescriptor 对象的数组。 它可以是 null
。
返回
列表名称。
示例
下面的代码示例演示如何实现 GetListName 方法。 有关完整代码列表,请参阅 如何:实现 ITypedList 接口。
// This method is only used in the design-time framework
// and by the obsolete DataGrid control.
public string GetListName(PropertyDescriptor[] listAccessors)
{
return typeof(T).Name;
}
' This method is only used in the design-time framework
' and by the obsolete DataGrid control.
Public Function GetListName( _
ByVal listAccessors() As PropertyDescriptor) As String _
Implements System.ComponentModel.ITypedList.GetListName
Return GetType(Tkey).Name
End Function
注解
此方法仅在设计时框架中由过时 DataGrid 的控件使用。
适用于
另请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈