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