共用方式為


WebPart.ShouldSerializeAllowConnect method

會傳回AllowConnect屬性是否有所變更其預設值。

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

Syntax

'宣告
Public Overridable Function ShouldSerializeAllowConnect As Boolean
'用途
Dim instance As WebPart
Dim returnValue As Boolean

returnValue = instance.ShouldSerializeAllowConnect()
public virtual bool ShouldSerializeAllowConnect()

傳回值

Type: System.Boolean
true屬性已變更,預設值 ;否則,請false.

備註

由於AllowConnect屬性沒有簡單的預設值,會提供ShouldSerializeAllowConnect方法。此方法會指出屬性是否有所變更其預設值。您通常叫用這個方法開發 designer WebPart類別,或建立您自己的網頁組件或工具組件時,讓您可以避免整天保存的預設值。

如果您覆寫此函數,請將您的函數應傳回true ,如果已從其預設值變更對應的屬性或SerializeAll屬性為true。例如:

public override bool ShouldSerializeAllowConnect() { return SerializeAll || defaultAllowConnect != _allowConnect; }

請參閱

參照

WebPart class

WebPart members

Microsoft.SharePoint.WebPartPages namespace