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.
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 static void ExportPreferenceObject<T>( string filePath, string preferenceClassName, string preferenceObjectName, T preferenceObjectValue )
Parameters
- filePath
- Type: SystemString
A full path to the location to which the Preference Object is to be saved. Note that exceptions will be thrown if the path is not valid or if it is not possible to save the file to that location for some reason. - preferenceClassName
- Type: SystemString
The Name of Preference Class to store the preferenceObjectValue under. - preferenceObjectName
- Type: SystemString
The Name of Preference Object to save. - preferenceObjectValue
- Type: T
The Value of Preference Object to save.
Type Parameters
- T
- The type of the Preference Object value. It is required of the type to be serializable.
Exceptions
Exception | Condition |
---|---|
ArgumentException | If filePath, preferenceClassName or preferenceObjectName is null or empty. |
ArgumentNullException | If preferenceObjectValue is null. |
IOException | If the file could not be created. |
SerializationException | If the Preference Object could not be serialized to file. |
Version Information
See Also