SPWebPartManager.CanSPConnectWebParts 方法
检查将参与连接以确定是否可以使用SPWebPartConnection以形成它们之间的连接 Web 部件。
命名空间: Microsoft.SharePoint.WebPartPages
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
Public Function CanSPConnectWebParts ( _
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.CanSPConnectWebParts(provider, _
providerConnectionPoint, consumer, _
consumerConnectionPoint, transformer)
public bool CanSPConnectWebParts(
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用作回调方法,以便provider可以参与连接的连接点。
consumer
类型:System.Web.UI.WebControls.WebParts.WebPart从provider接收数据,当控件连接 Web 部件。
consumerConnectionPoint
类型:System.Web.UI.WebControls.WebParts.ConsumerConnectionPoint用作回调方法,以便consumer可以参与连接的连接点。
transformer
类型:System.Web.UI.WebControls.WebParts.WebPartTransformer启用兼容provider和consumer连接WebPartTransformer 。如果providerConnectionPoint和consumerConnection点具有相同的接口类型,则可以传递空引用(无 在 Visual Basic 中) 。
返回值
类型:System.Boolean
true如果可以使用SPWebPartConnection以形成 Web 部件中 ; 之间的连接否则为false。
备注
此方法将返回false任何以下情况下:
providerConnectionPoint和consumerConnectionPoint是Windows SharePoint Services 2.0连接接口。
provider或consumer Web 部件区域中不是。
关闭consumer或provider Web 部件。
providerConnectionPoint或consumerConnectionPoint无法参与连接。
多个连接尝试providerConnectionPoint或consumerConnectionPoint上并且连接不支持多个连接。
consumerConnectionPoint和providerConnectionPoint接口不相同的类型和转换器既未提供或转换器不支持所需的providerConnectionPoint或consumerConnectionPoint的界面类型。