WebPart.ShouldSerializeAllowZoneChange method
會傳回AllowZoneChange屬性是否有所變更其預設值。
Namespace: Microsoft.SharePoint.WebPartPages
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Overridable Function ShouldSerializeAllowZoneChange As Boolean
'用途
Dim instance As WebPart
Dim returnValue As Boolean
returnValue = instance.ShouldSerializeAllowZoneChange()
public virtual bool ShouldSerializeAllowZoneChange()
傳回值
Type: System.Boolean
true已變更屬性值,從預設值 ;否則,請false。
備註
由於AllowZoneChange屬性沒有簡單的預設值,會提供ShouldSerializeAllowZoneChange方法。此方法會指出屬性是否有所變更其預設值。您通常叫用這個方法開發 designer WebPart類別,或建立您自己的網頁組件或工具組件時,讓您可以避免整天保存的預設值。
如果您覆寫此函數,請將您的函數應該傳回true ,已變更之對應屬性,從其預設值,或SerializeAll屬性是true.例如:
public override bool ShouldSerializeAllowZoneChange()
{
return SerializeAll || defaultAllowZoneChange != _allowZoneChange;
}