ITypedList.GetListName(PropertyDescriptor[]) 方法

定义

返回列表名称。

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 的控件使用。

适用于

另请参阅