DedicatedThreadAccessible
Spotfire.Dxp.Framework.PreferencesPreferenceBase
Spotfire.Dxp.Application.ExtensionCustomPreference
Namespace: Spotfire.Dxp.Application.Extension
Assembly: Spotfire.Dxp.Application (in Spotfire.Dxp.Application.dll) Version: 25.11.10401.3615 (25.11.10401.3615)
public abstract class CustomPreference : PreferenceBase
The CustomPreference type exposes the following members.
Name | Description | |
---|---|---|
CustomPreference |
Initializes a new instance of the CustomPreference class.
|
Name | Description | |
---|---|---|
AddPreferenceT |
Call this method (in the constructor of your
concrete preference class implementation) to add a new property
to your preference class.
(Inherited from PreferenceBase.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnPropertyChanged | Override this method to perform desired operations when a
the value of a property has changed.
(Inherited from PreferenceBase.) | |
Reset |
Resets all values that may explicitly have been given to the properties
of this preference on a user level basis through a calls to
Value. The effect of resetting a
property is that when the Value of it is queried, either the
group value or the default value will be returned.
(Inherited from PreferenceBase.) | |
Save | Persists all changes to the properties of this preference object.
(Inherited from PreferenceBase.) | |
UndoChanges | Undoes any changes that may have been to all of the properties
of this preference, since it was last saved.
(Inherited from PreferenceBase.) |
Name | Description | |
---|---|---|
Category | Implementations of this property are to return the name of
the category to which the preference belongs. The category name must
not be null or an empty string for the preference to be
properly persisted.
(Inherited from PreferenceBase.) | |
IsEmpty | Gets a value indicating whether this preference object only contains default property values or not.
(Inherited from PreferenceBase.) | |
SubCategory | Implementations of this property are to return the name of
the subcategory to which the preference belongs. The subcategory
must not be null or an empty string for the preference to
be properly persisted.
(Inherited from PreferenceBase.) |
Name | Description | |
---|---|---|
PropertyChanged | Occurs when one of the properties in this preference is changed.
(Inherited from PreferenceBase.) |
When a user is logged on, the preference is populated with its persisted values, if such exist. If not, the preference is given default values while waiting for the user to set its values. When preferences are saved, their values are persisted using .Net serialization on the client and on the server depending on the settings of the preference.
Preferences properties can be applied to single users or to user groups. Preferences applied to a group are inherited by all members of the group. The users can, however, choose to override the properties with custom values. In the same way, a group can override the properties inherited from its parent groups. If the group has more than one parent group, the value from the Primary parent group (as defined using the TIBCO Spotfire Administration Manager).
It is important for your preference implementation class to be decorated with the PersistenceVersionAttribute. If it is not, it will not be possible to register the preference class with the preference framework.
[Spotfire.Dxp.Framework.Persistence.PersistenceVersion(1, 0)] public class MyPreference : CustomPreference { private PreferenceProperty<string> myString; // Defaults to null private PreferenceProperty<ArrayList> numberList; public override string Category { get { return "MyCategory"; } } public override string SubCategory { get { return "MySubCategory"; } } public void AddToList(int value) { this.numberList.Value.Add(value); // Notify the framework of changes this.numberList.OnValueChanged(); } public string MyString { get { return this.myString.Value; } set { // The framwork is aware of the change to the property since // it is explicitly set. this.myString.Value = value; } } public MyPreference() { this.myString = this.AddPreference<string>( new PreferenceProperty<string>( "myString", "1.0", PreferencePersistenceScope.Server, PreferenceUsage.SingleUser)); this.numberList = this.AddPreference<ArrayList>( new PreferenceProperty<ArrayList>( "numberList", "1.0", PreferencePersistenceScope.Server, PreferenceUsage.SingleUser, delegate { // Calculate the default value ArrayList defaultList = new ArrayList(); defaultList.Add(10); return defaultList; })); } }