ConnectionConsumerAttribute.DisplayName 属性

定义

获取使用者连接点的友好名称。Gets the friendly name of the consumer connection point.

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

属性值

String

一个字符串,该字符串包含使用者连接点的友好显示名称。A string containing a friendly display name for the consumer connection point.

示例

下面的代码示例演示如何使用 DisplayName 属性,方法是说明如何 ConnectionConsumerAttribute 在使用者控件中的回调方法上声明 metadata 元素。The following code example demonstrates using the DisplayName property, by showing how to declare the ConnectionConsumerAttribute metadata element on a callback method in a consumer control. 请注意,使用构造函数的最简单重载;仅 displayName 提供参数值。Note that the simplest overload of the constructor is used; only the displayName parameter value is supplied. 参数的值将成为属性的值 DisplayNameThe value of the parameter will become the value of the DisplayName property. 有关运行代码示例所需的完整代码,请参阅 ConnectionConsumerAttribute 类概述。For the full code required to run the code example, see the ConnectionConsumerAttribute class overview.

[ConnectionConsumer("Row")]
public void SetConnectionInterface(IWebPartRow provider) 
{
    _provider = provider;
}
    <ConnectionConsumer("Row")> _
    Public Sub SetConnectionInterface(ByVal provider As IWebPartRow)
        _provider = provider

    End Sub
End Class

注解

此属性是使用者连接点的友好名称。This property is the friendly name of a consumer connection point. 当你将 displayName 参数添加到 ConnectionConsumerAttribute 回调方法上的元数据元素时,可以通过声明方式设置其值。Its value can be set declaratively, when you add the displayName parameter to a ConnectionConsumerAttribute metadata element on a callback method. 还可以通过使用受保护的属性以编程方式设置派生类 DisplayNameValueIt can also be set programmatically by a derived class, by using the protected DisplayNameValue property.

在搜索连接点集合时,应使用 ID 属性,因为 ID 属性必须唯一,但 DisplayName 属性不需要。When you are searching through a connection point collection, you should use the ID property, because the ID property must be unique, but the DisplayName property need not be.

DisplayName当控件位于页面上时,将向用户显示使用者连接点的属性 ConnectionsZone , (UI) 的连接用户界面处于打开状态,并且用户处于允许从中选择连接点以建立连接的视图中。The DisplayName property of a consumer connection point is displayed to users when a ConnectionsZone control is on the page, the connection user interface (UI) is open, and the users are in a view where they are allowed to select connection points to establish a connection.

适用于

另请参阅