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