ConsumerConnectionPoint.SupportsConnection(Control, ConnectionInterfaceCollection) 方法
定义
确定使用者连接点当前能否建立连接。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
参数
- control
- Control
与 ConsumerConnectionPoint 相关联的使用者控件。The consumer control associated with the ConsumerConnectionPoint.
- secondaryInterfaces
- ConnectionInterfaceCollection
参与连接的任何辅助接口的 ConnectionInterfaceCollection。A ConnectionInterfaceCollection of any secondary interfaces that participate in a connection.
返回
如果连接点当前可建立连接,则为 true;否则为 false。true if a connection point can currently establish a connection; otherwise, false. 默认值为 true。The default is true.
注解
SupportsConnection实现的方法始终返回 true 类的所有事例 ConsumerConnectionPoint 。The SupportsConnection method as implemented always returns true in all cases for the ConsumerConnectionPoint class. 此方法的目的是让它在某些关键点上检查和的状态, control secondaryInterfaces 以确定 ConsumerConnectionPoint 对象目前是否能够创建连接。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.
在某些情况下,可能会出现这样的情况:无法 control 建立连接,或者必须在何处才能 secondaryInterfaces 形成连接。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. 在这种情况下,开发人员可以从 ConsumerConnectionPoint 类继承并重写 SupportsConnection 方法,并提供自定义实现来确定连接点何时可支持连接。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.