ConnectionProviderAttribute Constructors

Definition

Initializes a new instance of the ConnectionProviderAttribute class, specifying a value to use for the connection point display name, and optionally specifying values to use for the connection point's ID, the connection point type, or both.

Overloads

ConnectionProviderAttribute(String)

Initializes a new instance of the ConnectionProviderAttribute class, specifying a display name for the provider connection point.

ConnectionProviderAttribute(String, String)

Initializes a new instance of the ConnectionProviderAttribute class, specifying a display name and an ID for the provider connection point.

ConnectionProviderAttribute(String, Type)

Initializes a new instance of the ConnectionProviderAttribute class, specifying a display name and a specific type of connection point object to use for the provider connection point.

ConnectionProviderAttribute(String, String, Type)

Initializes a new instance of the ConnectionProviderAttribute class, specifying a display name, an ID, and a specific type of connection point object to use for the provider connection point.

Remarks

A provider control can have multiple methods marked with the ConnectionProviderAttribute metadata element. In this case, the provider would have multiple connection points, and each instance of the ConnectionProviderAttribute element should specify a unique ID value for the associated connection point, so that the provider's connection points can be distinguished.

ConnectionProviderAttribute(String)

Initializes a new instance of the ConnectionProviderAttribute class, specifying a display name for the provider connection point.

public:
 ConnectionProviderAttribute(System::String ^ displayName);
public ConnectionProviderAttribute (string displayName);
new System.Web.UI.WebControls.WebParts.ConnectionProviderAttribute : string -> System.Web.UI.WebControls.WebParts.ConnectionProviderAttribute
Public Sub New (displayName As String)

Parameters

displayName
String

A string that contains a friendly name for the provider connection point to display in the user interface (UI).

Exceptions

displayName is null.

Examples

The following code example demonstrates using the ConnectionProviderAttribute class, by showing how to declare the ConnectionProviderAttribute metadata element on a callback method in a provider control. Note that the simplest overload of the constructor is used; only the displayName parameter value is supplied. For the full code required to run the code example, see the ConnectionProviderAttribute class overview.

[ConnectionProvider("Row")]
public IWebPartRow GetConnectionInterface()
{
    return new RowProviderWebPart();
}
<ConnectionProvider("Row")> _
Public Function GetConnectionInterface() As IWebPartRow
    Return New RowProviderWebPart()

End Function 'GetConnectionInterface

Remarks

This constructor creates an instance of the attribute that is used with a method of a Web Parts control acting as a provider. This method becomes the connection point between the provider and the consumer. Typically, the way you use this constructor is to declare a ConnectionProviderAttribute metadata element on a method that you want to designate as a callback method in a provider control.

The displayName parameter is a friendly name of the provider connection point that is used by the ConnectionsZone control to represent a provider's connection point in the UI.

See also

Applies to

ConnectionProviderAttribute(String, String)

Initializes a new instance of the ConnectionProviderAttribute class, specifying a display name and an ID for the provider connection point.

public:
 ConnectionProviderAttribute(System::String ^ displayName, System::String ^ id);
public ConnectionProviderAttribute (string displayName, string id);
new System.Web.UI.WebControls.WebParts.ConnectionProviderAttribute : string * string -> System.Web.UI.WebControls.WebParts.ConnectionProviderAttribute
Public Sub New (displayName As String, id As String)

Parameters

displayName
String

A string that contains a friendly name for the provider connection point to display in the user interface (UI).

id
String

The ID, a unique string value assigned to the provider connection point.

Exceptions

displayName or id is null.

Remarks

The displayName parameter is a friendly name of the provider connection point that is used by the ConnectionsZone control to represent a provider's connection point in the UI.

The id parameter is used to specify the ID for the provider connection point associated with the specific callback method. A control can have multiple connection points, but the id for each must be unique. Therefore, this overload of the constructor is useful if you have multiple callback methods in your provider control.

See also

Applies to

ConnectionProviderAttribute(String, Type)

Initializes a new instance of the ConnectionProviderAttribute class, specifying a display name and a specific type of connection point object to use for the provider connection point.

public:
 ConnectionProviderAttribute(System::String ^ displayName, Type ^ connectionPointType);
public ConnectionProviderAttribute (string displayName, Type connectionPointType);
new System.Web.UI.WebControls.WebParts.ConnectionProviderAttribute : string * Type -> System.Web.UI.WebControls.WebParts.ConnectionProviderAttribute
Public Sub New (displayName As String, connectionPointType As Type)

Parameters

displayName
String

A string that contains a friendly name for the provider connection point to display in the user interface (UI).

connectionPointType
Type

A Type that derives from ConnectionPoint, and that you want to specify as the type of connection point object to use with a specific callback method.

Exceptions

displayName or connectionPointType is null.

connectionPointType is not valid.

Remarks

The displayName parameter is a friendly name of the provider connection point that is used by the ConnectionsZone control to represent a provider's connection point in the UI.

The connectionPointType parameter must be a Type derived from ProviderConnectionPoint. If this parameter is specified, the Type is used to create the connection point instead of the standard ProviderConnectionPoint class provided with the Web Parts control set.

See also

Applies to

ConnectionProviderAttribute(String, String, Type)

Initializes a new instance of the ConnectionProviderAttribute class, specifying a display name, an ID, and a specific type of connection point object to use for the provider connection point.

public:
 ConnectionProviderAttribute(System::String ^ displayName, System::String ^ id, Type ^ connectionPointType);
public ConnectionProviderAttribute (string displayName, string id, Type connectionPointType);
new System.Web.UI.WebControls.WebParts.ConnectionProviderAttribute : string * string * Type -> System.Web.UI.WebControls.WebParts.ConnectionProviderAttribute
Public Sub New (displayName As String, id As String, connectionPointType As Type)

Parameters

displayName
String

A string that contains a friendly name for the provider connection point to display in the user interface (UI).

id
String

The ID, a unique string value assigned to the provider connection point.

connectionPointType
Type

A Type that derives from ProviderConnectionPoint, and that you want to specify as the type of connection point object to use with a specific callback method.

Exceptions

displayName, id, or connectionPointType is null.

connectionPointType is not valid.

Remarks

The displayName parameter is a friendly name of the provider connection point that is used by the ConnectionsZone control to represent a provider's connection point in the UI.

The id parameter is used to specify the ID for the provider connection point associated with the specific callback method. A control can have multiple connection points, but the id for each must be unique. Therefore, this overload of the constructor is useful if you have multiple callback methods in your provider control.

The connectionPointType parameter must be a Type derived from ProviderConnectionPoint. If this parameter is specified, the Type is used to create the connection point instead of the standard ProviderConnectionPoint class provided with the Web Parts control set.

See also

Applies to