Redigera

Dela via


ConsumerConnectionPoint.SupportsConnection Method

Definition

Determines whether a consumer connection point is currently capable of establishing a connection.

public:
 virtual bool SupportsConnection(System::Web::UI::Control ^ control, System::Web::UI::WebControls::WebParts::ConnectionInterfaceCollection ^ secondaryInterfaces);
public virtual bool SupportsConnection (System.Web.UI.Control control, System.Web.UI.WebControls.WebParts.ConnectionInterfaceCollection secondaryInterfaces);
abstract member SupportsConnection : System.Web.UI.Control * System.Web.UI.WebControls.WebParts.ConnectionInterfaceCollection -> bool
override this.SupportsConnection : System.Web.UI.Control * System.Web.UI.WebControls.WebParts.ConnectionInterfaceCollection -> bool
Public Overridable Function SupportsConnection (control As Control, secondaryInterfaces As ConnectionInterfaceCollection) As Boolean

Parameters

control
Control

The consumer control associated with the ConsumerConnectionPoint.

secondaryInterfaces
ConnectionInterfaceCollection

A ConnectionInterfaceCollection of any secondary interfaces that participate in a connection.

Returns

true if a connection point can currently establish a connection; otherwise, false. The default is true.

Remarks

The SupportsConnection method as implemented always returns true in all cases for the ConsumerConnectionPoint class. The intent for this method is to have it check on the state of control and secondaryInterfaces at certain critical points to determine whether a ConsumerConnectionPoint object is presently able to create a connection.

There can be scenarios where control is in a state that would make it impossible to form a connection, or where secondaryInterfaces must exist before a connection can be formed. In such cases, developers can inherit from the ConsumerConnectionPoint class, and override the SupportsConnection method, providing a custom implementation to determine when the connection point is ready to support connections.

Applies to