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
)
參數
provider
Type: System.Web.UI.WebControls.WebParts.WebPart提供資料給consumer ,當控制項已連接 「 網頁組件。
providerConnectionPoint
Type: System.Web.UI.WebControls.WebParts.ProviderConnectionPointProviderConnectionPoint做為回呼方法,因此該提供者可以參與連接。
consumer
Type: System.Web.UI.WebControls.WebParts.WebPart從provider接收資料,當控制項已連接 「 網頁組件。
consumerConnectionPoint
Type: System.Web.UI.WebControls.WebParts.ConsumerConnectionPointConsumerConnectionPoint做為回呼方法,使consumer可以參與連接。
transformer
Type: System.Web.UI.WebControls.WebParts.WebPartTransformerWebPartTransformer ,可讓不相容的提供者和消費者連接。
傳回值
Type: System.Boolean
true如果可以連線 Web 組件 ;否則, false。
備註
這個覆寫將會傳回false下任何下列條件:
無法連接兩個 Web 組件。
providerConnectionPoint或consumerConnectionPoint是Windows SharePoint Services 2.0連接介面。
provider或consumer的 Web 組件不是在區域中。