One or more preference properties constitute a preference implemented as a type extending Spotfire.Dxp.Framework.Preferences.PreferenceBase. Each preference property is identified by a name and the Spotfire.Dxp.Framework.Preferences.PreferenceBase.Category and Spotfire.Dxp.Framework.Preferences.PreferenceBase.SubCategory of the preference that it is contained in.

The value of a preference property is decided through inheritance, where user values always have precedence before group values, that is, a user can override that value of a property inherited from a group. The same way, a group can override the value of a parent group. In addition, the preference property may have a default values which is returned when neither parent group(s) nor the user has defined a value for the property.

Each property is also associated with a version number. This version number must always be increased if the property is changed from the prior version such that the new version cannot be interpreted by older version through the default behavior of the .Net serialization framework. For instance, if the type T is changed from System.String to System.Int32, the version number should be increased. The version number should also be increased if properties are added to or removed from T.

2.0

Type Parameters

  • T

Hierarchy (view full)

Methods

  • Casts this object to the specified type. Throws error on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns T1

  • Determines whether the specified object is equal to the current object.

    Parameters

    • obj: any

      The object to compare with the current object.

    Returns boolean

    true if the specified object is equal to the current object; otherwise, false.

  • Returns a string that represents the current object.

    Returns string

    A string that represents the current object.

  • Casts this object to the specified type. Returns null on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns null | T1

  • Determines whether the specified object instances are considered equal.

    Parameters

    • objA: any

      The first object to compare.

    • objB: any

      The second object to compare.

    Returns boolean

    true if the objects are considered equal; otherwise, false. If both objA and objB are null, the method returns true.

Default capability

  • get Name(): string
  • Gets the name of this property.

    Returns string

    2.0

  • get Value(): JsType<T>
  • Gets or sets the value of the property. A get request to this property will return the overridden value of a preference property. That is, if the user has overridden the value inherited from the user group, that inherited value is returned. Otherwise, the group value is returned. The same way, group values may override the values inherited from parent groups. If no value can be found, neither at the group level nor at the user level, a default value is returned. The default value is passed to the constructors of this class, either as a value or a Spotfire.Dxp.Framework.Preferences.PreferenceProperty.DefaultValueCalculatorCallback. If no default value exists, null is returned for reference types, and 0 is returned for value types.

    Setting the property will only affect the user level value and override the inherited group value (if such exists).

    After setting or resetting the value of a preference property, Save() must be called on the owning preference to cause the property to be persisted.

    Returns JsType<T>

    2.0

  • set Value(value): void
  • Parameters

    Returns void

  • get ValueType(): Type
  • Gets the type of the value of this property.

    Returns Type

    2.0

  • Undoes any changes that may have been to the value of this property since it was last saved.

    Returns void

    2.0