Adds a PreferenceObjectT to the current user's
personal defined set of objects. The added object will be stored
locally until synchronized with the server, which occurs immediately
if the application is connected to the server, or at the next login
if it is not.
Note that the preference object being added must be globally unique identified by its class and its name. If an object with the same name already has been added, the object is only added to the local cache and never synchronized with the server.
Namespace: Spotfire.Dxp.Framework.Preferences
Assembly: Spotfire.Dxp.Framework (in Spotfire.Dxp.Framework.dll) Version: 23.18.9504.3877 (23.18.9504.3877)
Syntax
C#
public void Add<T>( PreferenceObject<T> preferenceObject )
Parameters
- preferenceObject
- Type: Spotfire.Dxp.Framework.PreferencesPreferenceObjectT
The preference object to add. This object may not be null or an exeption is thrown.
Type Parameters
- T
- The type of the preference value for this preference object. The type must be serializable.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | If preferenceObject is null. |
ArgumentException | If a PreferenceObjectT with the same Id already has been added, or if T is incorrect, for example it does not comply with the type that has previously been registered with the default preference object. |
InvalidOperationException | If the preferenceObject is marked as a default object but a default object already exists either at application level or at user level. |
Version Information
See Also