ConnectionConsumerAttribute 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化类的新实例 ConnectionConsumerAttribute ,指定要用于连接点显示名称的值,并根据需要指定要用于连接点 ID、连接点类型或两者的值。
重载
| 名称 | 说明 |
|---|---|
| ConnectionConsumerAttribute(String) |
初始化类的新实例 ConnectionConsumerAttribute ,为使用者连接点指定显示名称。 |
| ConnectionConsumerAttribute(String, String) |
初始化类的新实例 ConnectionConsumerAttribute ,指定使用者连接点的显示名称和 ID。 |
| ConnectionConsumerAttribute(String, Type) |
初始化类的新实例 ConnectionConsumerAttribute ,指定用于使用者连接点的显示名称和特定类型的连接点对象。 |
| ConnectionConsumerAttribute(String, String, Type) |
初始化类的新实例 ConnectionConsumerAttribute ,指定用于使用者连接点的显示名称、ID 和特定类型的连接点对象。 |
注解
使用者控件可以有多个用 ConnectionConsumerAttribute 元数据元素标记的方法。 在这种情况下,使用者将有多个连接点,并且元素的每个实例 ConnectionConsumerAttribute 应为关联的连接点指定唯一的 ID 值,以便可以区分使用者的连接点。
ConnectionConsumerAttribute(String)
初始化类的新实例 ConnectionConsumerAttribute ,为使用者连接点指定显示名称。
public:
ConnectionConsumerAttribute(System::String ^ displayName);
public ConnectionConsumerAttribute(string displayName);
new System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute : string -> System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute
Public Sub New (displayName As String)
参数
- displayName
- String
一个字符串,其中包含在用户界面(UI)中显示的使用者连接点的友好名称。
例外
displayName 是 null。
示例
下面的代码示例演示如何使用 ConnectionConsumerAttribute 类,演示如何在使用者控件中的回调方法上声明 ConnectionConsumerAttribute 元数据元素。 请注意,使用构造函数的最简单重载; displayName 仅提供参数值。 有关运行代码示例所需的完整代码,请参阅 ConnectionConsumerAttribute 类概述。
[ConnectionConsumer("Row")]
public void SetConnectionInterface(IWebPartRow provider)
{
_provider = provider;
}
<ConnectionConsumer("Row")> _
Public Sub SetConnectionInterface(ByVal provider As IWebPartRow)
_provider = provider
End Sub
End Class
注解
此构造函数创建一个特性的实例,该实例与充当使用者的 Web 部件控件的方法一起使用。 此方法将成为提供程序与使用者之间的连接点。 通常,使用此构造函数的方式是在想要在使用者控件中指定为回调方法的方法上声明 ConnectionConsumerAttribute 元数据元素。
该 displayName 参数是控件用来 ConnectionsZone 表示 UI 中的使用者连接点的使用者连接点的友好名称。
另请参阅
适用于
ConnectionConsumerAttribute(String, String)
初始化类的新实例 ConnectionConsumerAttribute ,指定使用者连接点的显示名称和 ID。
public:
ConnectionConsumerAttribute(System::String ^ displayName, System::String ^ id);
public ConnectionConsumerAttribute(string displayName, string id);
new System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute : string * string -> System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute
Public Sub New (displayName As String, id As String)
参数
- displayName
- String
一个字符串,其中包含在用户界面(UI)中显示的使用者连接点的友好名称。
例外
displayName 或 id 为 null.
注解
该 displayName 参数是控件用来 ConnectionsZone 表示 UI 中的使用者连接点的使用者连接点的友好名称。
该 id 参数用于指定与特定回调方法关联的使用者连接点的 ID。 控件可以有多个连接点,但 id 每个连接点必须是唯一的。 因此,如果在使用者控件中有多个回调方法,则构造函数的此重载非常有用。
另请参阅
适用于
ConnectionConsumerAttribute(String, Type)
初始化类的新实例 ConnectionConsumerAttribute ,指定用于使用者连接点的显示名称和特定类型的连接点对象。
public:
ConnectionConsumerAttribute(System::String ^ displayName, Type ^ connectionPointType);
public ConnectionConsumerAttribute(string displayName, Type connectionPointType);
new System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute : string * Type -> System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute
Public Sub New (displayName As String, connectionPointType As Type)
参数
- displayName
- String
一个字符串,其中包含在用户界面(UI)中显示的使用者连接点的友好名称。
- connectionPointType
- Type
Type派生自ConsumerConnectionPoint的,并且你想要指定为要用于特定回调方法的连接点对象的类型。
例外
displayName 或 connectionPointType 为 null.
connectionPointType 无效。
注解
该 displayName 参数是控件用来 ConnectionsZone 表示 UI 中的使用者连接点的使用者连接点的友好名称。
参数 connectionPointType 必须是 Type 派生自 ConsumerConnectionPoint. 如果指定此参数, Type 则用于创建连接点,而不是 Web 部件控件集提供的标准 ConsumerConnectionPoint 类。
另请参阅
适用于
ConnectionConsumerAttribute(String, String, Type)
初始化类的新实例 ConnectionConsumerAttribute ,指定用于使用者连接点的显示名称、ID 和特定类型的连接点对象。
public:
ConnectionConsumerAttribute(System::String ^ displayName, System::String ^ id, Type ^ connectionPointType);
public ConnectionConsumerAttribute(string displayName, string id, Type connectionPointType);
new System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute : string * string * Type -> System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute
Public Sub New (displayName As String, id As String, connectionPointType As Type)
参数
- displayName
- String
一个字符串,其中包含在用户界面(UI)中显示的使用者连接点的友好名称。
- connectionPointType
- Type
Type派生自ConsumerConnectionPoint的,并且你想要指定为要用于特定回调方法的连接点对象的类型。
例外
displayName, id或 connectionPointType 为 null。
connectionPointType 无效。
注解
该 displayName 参数是控件用来 ConnectionsZone 表示 UI 中的使用者连接点的使用者连接点的友好名称。
该 id 参数用于指定与特定回调方法关联的使用者连接点的 ID。 控件可以有多个连接点,但 id 每个连接点必须是唯一的。 因此,如果在使用者控件中有多个回调方法,则构造函数的此重载非常有用。
参数 connectionPointType 必须是 Type 派生自 ConsumerConnectionPoint. 如果指定此参数, Type 则用于创建连接点,而不是 Web 部件控件集提供的标准 ConsumerConnectionPoint 类。