共用方式為


SPWebPartManager.CanConnectWebParts method (WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)

檢查會參與以判斷它們是否可以連線,並使用WebPartTransformer物件建立不相容的消費者和提供者之間的連線連接 Web 組件。

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
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
)

參數

傳回值

Type: 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 class

SPWebPartManager members

CanConnectWebParts overload

Microsoft.SharePoint.WebPartPages namespace