WebPart.ShouldSerializeAllowZoneChange 方法
返回AllowZoneChange属性是否已从其默认值进行更改。
命名空间: Microsoft.SharePoint.WebPartPages
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
Public Overridable Function ShouldSerializeAllowZoneChange As Boolean
用法
Dim instance As WebPart
Dim returnValue As Boolean
returnValue = instance.ShouldSerializeAllowZoneChange()
public virtual bool ShouldSerializeAllowZoneChange()
返回值
类型:System.Boolean
true属性值已更改的默认值 ; 如果否则为false。
备注
由于AllowZoneChange属性没有简单的默认值提供ShouldSerializeAllowZoneChange方法。此方法指示属性是否已从其默认值进行更改。您通常调用此方法如果正在开发的设计器WebPart类中,或创建您自己的 Web 部件或工具部件,以便您可以避免不必要地保留默认值。
如果覆盖此函数,您的函数应返回true ,如果相应属性已从其默认值更改或SerializeAll属性是true. ,例如:
public override bool ShouldSerializeAllowZoneChange()
{
return SerializeAll || defaultAllowZoneChange != _allowZoneChange;
}