CustomizableString class

SharePoint Online

Represents a string-typed property with a default value that is used if a custom value has not been explicitly assigned.


Namespace:  Microsoft.SharePoint.Client.Publishing
Assembly:  Microsoft.SharePoint.Client.Publishing (in Microsoft.SharePoint.Client.Publishing.dll)

public sealed class CustomizableString : ClientObject

It is common for a setting to have a default value that is calculated somehow—for example, it is inherited from the parent object. If a custom value is not specified, then the default value is used. Since the default value is calculated, it can cause the effective value to change. For example, if the default is inherited from a parent object, then the effective value may change because the parent was changed. By contrast, if a custom value has been assigned, then these external influences will not occur, even if the custom value happens to be the same string as the default value. The CustomizableString object manages three pieces of information: the current value, a read-only default value, and a Boolean state that indicates whether the default is being used.

For example, the FriendlyUrlSegment property is represented as a CustomizableString object for which a default value is generated from the name of the underlying Term object is automatically reflected as changes to the generated URL segment. If a custom URL segment is not explicitly assigned, then changes to the name of the Term object will be reflected automatically as changes to the generated URL segment.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.