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
)

参数

返回值

类型:System.Boolean
true如果可连接 Web 部件 ;否则为false。

备注

此重写将返回false任何以下情况下:

  1. 无法连接两个 Web 部件。

  2. providerConnectionPoint或consumerConnectionPoint是Windows SharePoint Services 2.0连接接口。

  3. 在区域中没有provider或consumer Web 部件。

  4. CanSPConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)返回false。

另请参阅

引用

SPWebPartManager 类

SPWebPartManager 成员

CanConnectWebParts 重载

Microsoft.SharePoint.WebPartPages 命名空间