ConnectionConsumerAttribute 建構函式

定義

初始化 ConnectionConsumerAttribute 類別的新執行個體,指定要用於連接點顯示名稱的值,以及選擇性地指定要用於連接點的 ID、連接點類型或這兩者的值。

多載

ConnectionConsumerAttribute(String)

初始化 ConnectionConsumerAttribute 類別的新執行個體,並指定消費者連接點的顯示名稱。

ConnectionConsumerAttribute(String, String)

初始化 ConnectionConsumerAttribute 類別的新執行個體,並指定消費者連接點的顯示名稱和 ID。

ConnectionConsumerAttribute(String, Type)

初始化 ConnectionConsumerAttribute 類別的新執行個體,並指定要用於消費者連接點的顯示名稱和連接點物件的特定型別。

ConnectionConsumerAttribute(String, String, Type)

ConnectionConsumerAttribute 類別的新執行個體初始化,指定要用於消費者連接點的顯示名稱、識別碼和特定類型的連接點物件。

備註

取用者控制項可以有多個方法標記 ConnectionConsumerAttribute 中繼資料元素。 在此情況下,取用者會有多個連接點,而且元素的每個實例 ConnectionConsumerAttribute 都應該為相關聯的連接點指定唯一識別碼值,以便區分取用者的連接點。

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) 中顯示的消費者連接點易記名稱。

例外狀況

displayNamenull

範例

下列程式碼範例示範如何使用 類別,示範如何在取用 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) 中顯示的消費者連接點易記名稱。

id
String

ID,為指派給消費者連接點的唯一字串值。

例外狀況

displayNameidnull

備註

參數 displayName 是取用者連接點的易記名稱,控制項 ConnectionsZone 用來表示 UI 中的取用者連接點。

參數 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

衍生自 ConsumerConnectionPointType,且您想要加以指定為搭配特定回呼方法使用的連接點物件類型。

例外狀況

displayNameconnectionPointTypenull

connectionPointType 無效。

備註

參數 displayName 是取用者連接點的易記名稱,控制項 ConnectionsZone 用來表示 UI 中的取用者連接點。

參數 connectionPointType 必須是 Type 衍生自 ConsumerConnectionPoint 的 。 如果指定此參數,則會 Type 使用 來建立連接點,而不是與Web 組件控制項集一起提供的標準 ConsumerConnectionPoint 類別。

另請參閱

適用於

ConnectionConsumerAttribute(String, String, Type)

ConnectionConsumerAttribute 類別的新執行個體初始化,指定要用於消費者連接點的顯示名稱、識別碼和特定類型的連接點物件。

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) 中顯示的消費者連接點易記名稱。

id
String

ID,為指派給消費者連接點的唯一字串值。

connectionPointType
Type

衍生自 ConsumerConnectionPointType,且您想要加以指定為搭配特定回呼方法使用的連接點物件類型。

例外狀況

displayNameidconnectionPointTypenull

connectionPointType 無效。

備註

參數 displayName 是取用者連接點的易記名稱,控制項 ConnectionsZone 用來表示 UI 中的取用者連接點。

參數 id 是用來指定與特定回呼方法相關聯之取用者連接點的識別碼。 控制項可以有多個連接點,但 id 每個 的 必須是唯一的。 因此,如果您的取用者控制項中有多個回呼方法,這個建構函式的多載就很有用。

參數 connectionPointType 必須是 Type 衍生自 ConsumerConnectionPoint 的 。 如果指定此參數,則會 Type 使用 來建立連接點,而不是與Web 組件控制項集一起提供的標準 ConsumerConnectionPoint 類別。

另請參閱

適用於