PreferenceObjectService Class

Spotfire 14.2 API Reference
Provides functionality to retrieve, add, and delete preference objects for the currently logged on user. There is only one object of this type available in the application. This instance is registered as a top-level service and can be accessed through one of the service provider methods. New instances of this type cannot be created.

A preference object defines a value that can be set as a preference. All preference objects are ordered in preference classes which defines categories of preference values.

Preference objects created through this service, are cached locally on the computer until synchronized with the server, at which point the settings are written to the server. The synchronization procedure is automatically managed, but doing so requires the application to be connected to the server.

When this service is initialized during application start-up, it will synchronize with the server to download new preference objects that may have been added for the currently logged on user. This, again, requires a connection to the server.

Inheritance Hierarchy

SystemObject
  DedicatedThreadAccessible
    DedicatedThreadService
      Spotfire.Dxp.Framework.PreferencesPreferenceObjectService

Namespace:  Spotfire.Dxp.Framework.Preferences
Assembly:  Spotfire.Dxp.Framework (in Spotfire.Dxp.Framework.dll) Version: 64.0.19329.3263 (64.0.19329.3263)
Syntax

C#
public class PreferenceObjectService : DedicatedThreadService

The PreferenceObjectService type exposes the following members.

Methods

  NameDescription
Public methodAddT
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.

Public methodAddApplicationDefaultT
Public methodApplyChangesT
Applies changes made to a PreferenceObjectT in the current users own defined set of preference objects. Note that this call requires the object to have previously been added to the user's preferences.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExists
Checks whether or not a preference object exists.
Public methodStatic memberExportPreferenceObjectT
Persists a PreferenceObjectT to file. Note that the Preference Object will not be added to the current user's set of object by calling this method; it will only be stored to file.

The export mechanism is based on the .Net XML serialization and therefore it is required of type T to implement all prerequisites for such serialization to be possible.

Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFindT
Finds the one and only PreferenceObjectT in the class defined by className that has the same value as value and the id as objectId. If no such object is not found, the first object in the class that has the same value as T will be returned even if it doesn't have the same id as objectId. If no object with the same value as T is found, a default object defined for the class will be returned.
Public methodFindAllT
Finds all Preference Objects in the class defined by className that have the same value as value and returns the identifiers of the objects found. Note that it is very important for the type T to override the Equals(Object) method with an appropriate implementation, since that implementation alone affects the objects will match the given search condition object, value.
Public methodGetAllObjectNames
Gets the names of all preference objects for the Preference Class given by className, including the application default object.
Public methodGetDefaultObjectNameT
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetObjectT
Gets one specific PreferenceObjectT with the identity defined by objectId. The retrieval is performed according to the following sets of rules: If the requested preference object is found, return it.Else, if there is a user defined default object, return it.Else, if there is a group level defined default object, return it. If the user is a member of more than one group, an individual group order determines which default preference object to use. Else, if there is an application default object, return it.Else, throw exception.
Public methodGetObjectsT
Gets all preference objects of a specified class defined by className.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemoveT
Removes a preference object from the current users own defined set of objects.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Version Information

Supported in: 14.2, 14.1, 14.0, 12.5, 12.4, 12.3, 12.2, 12.1, 12.0, 11.8, 11.7, 11.6, 11.5, 11.4
See Also

Reference