SPWebPartManager.CanConnectWebParts 方法 (WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)
检查将参与连接以确定它们是否可以连接,并使用WebPartTransformer对象来创建不兼容的使用者和提供程序之间的连接 Web 部件。
命名空间: Microsoft.SharePoint.WebPartPages
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
Public Overrides Function CanConnectWebParts ( _
provider As WebPart, _
providerConnectionPoint As ProviderConnectionPoint, _
consumer As WebPart, _
consumerConnectionPoint As ConsumerConnectionPoint, _
transformer As WebPartTransformer _
) As Boolean
用法
Dim instance As SPWebPartManager
Dim provider As WebPart
Dim providerConnectionPoint As ProviderConnectionPoint
Dim consumer As WebPart
Dim consumerConnectionPoint As ConsumerConnectionPoint
Dim transformer As WebPartTransformer
Dim returnValue As Boolean
returnValue = instance.CanConnectWebParts(provider, _
providerConnectionPoint, consumer, _
consumerConnectionPoint, transformer)
public override bool CanConnectWebParts(
WebPart provider,
ProviderConnectionPoint providerConnectionPoint,
WebPart consumer,
ConsumerConnectionPoint consumerConnectionPoint,
WebPartTransformer transformer
)
参数
provider
类型:System.Web.UI.WebControls.WebParts.WebPartWeb 部件提供数据到consumer时控件已连接。
providerConnectionPoint
类型:System.Web.UI.WebControls.WebParts.ProviderConnectionPoint用作回调方法,以便该提供商可以参与连接ProviderConnectionPoint 。
consumer
类型:System.Web.UI.WebControls.WebParts.WebPart从provider接收数据,当控件连接 Web 部件。
consumerConnectionPoint
类型:System.Web.UI.WebControls.WebParts.ConsumerConnectionPoint用作回调方法,以便consumer可以参与连接ConsumerConnectionPoint 。
transformer
类型:System.Web.UI.WebControls.WebParts.WebPartTransformer允许不兼容的提供程序和使用者连接WebPartTransformer 。
返回值
类型:System.Boolean
true如果可连接 Web 部件 ;否则为false。
备注
此重写将返回false任何以下情况下:
无法连接两个 Web 部件。
providerConnectionPoint或consumerConnectionPoint是Windows SharePoint Services 2.0连接接口。
在区域中没有provider或consumer Web 部件。