IOptionsWriter interface
The IOptionsWriter interface writes values for options on a page in the system wide Preferences or Project options dialog to a registry storage.
public interface IOptionsWriter
Namespace: DXP · Assembly: Altium.SDK.Interfaces
Methods
| Method | Returns | Description |
|---|---|---|
| EraseSection | void | This method removes all the option values for the section (targetted page in the system wide preferences dialog). |
| Flush | void | |
| WriteBoolean | void | This WriteBoolean method writes a boolean option value for the option name used by the specified server (SectionName) which is represented by the system wide Preferences dialog. |
| WriteDouble | void | This WriteDouble method writes a double value for the option name used by the specified server (SectionName) which is represented by the system wide Preferences dialog. |
| WriteInteger | void | This WriteInteger method writes an integral value for the option name used by the specified server (SectionName) which is represented by the system wide Preferences dialog. |
| WriteString | void | This WriteString method writes a string option value for the option name used by the specified server (SectionName) which is represented by the system wide Preferences dialog. |
EraseSection
This method removes all the option values for the section (targetted page in the system wide preferences dialog).
void EraseSection(string argSectionName);
| Parameter | Type | Passing |
|---|---|---|
argSectionName | string | value |
Returns: nothing (void)
Flush
No description yet.
void Flush();
Returns: nothing (void)
WriteBoolean
This WriteBoolean method writes a boolean option value for the option name used by the specified server (SectionName) which is represented by the system wide Preferences dialog.
void WriteBoolean(string argSectionName, string argValueName, bool argValue);
| Parameter | Type | Passing |
|---|---|---|
argSectionName | string | value |
argValueName | string | value |
argValue | bool | value |
Returns: nothing (void)
The section name is the targetted page in the system wide preferences dialog.
Example: Save two graphic viewer preferences as Boolean options.
using DXP;
// Placeholders: your server's name, its preferences section and the values to store.
string serverName = "<server name>";
string preferencesSection = "<preferences section>";
bool scaleImage = true;
bool keepAspectRatio = true;
IOptionsWriter writer = DXP.GlobalVars.Client.GetOptionsManager().GetOptionsWriter(serverName);
if (writer == null)
return;
writer.WriteBoolean(preferencesSection, "ScaleImage", scaleImage);
writer.WriteBoolean(preferencesSection, "KeepAspectRatio", keepAspectRatio);
Examples: Extension_SchPreference, Extension_SupplierPreference
WriteDouble
This WriteDouble method writes a double value for the option name used by the specified server (SectionName) which is represented by the system wide Preferences dialog.
void WriteDouble(string argSectionName, string argValueName, double argValue);
| Parameter | Type | Passing |
|---|---|---|
argSectionName | string | value |
argValueName | string | value |
argValue | double | value |
Returns: nothing (void)
The section name is the targetted page in the system wide preferences dialog.
WriteInteger
This WriteInteger method writes an integral value for the option name used by the specified server (SectionName) which is represented by the system wide Preferences dialog.
void WriteInteger(string argSectionName, string argValueName, int argValue);
| Parameter | Type | Passing |
|---|---|---|
argSectionName | string | value |
argValueName | string | value |
argValue | int | value |
Returns: nothing (void)
The section name is the targetted page in the system wide preferences dialog.
WriteString
This WriteString method writes a string option value for the option name used by the specified server (SectionName) which is represented by the system wide Preferences dialog.
void WriteString(string argSectionName, string argValueName, string argValue);
| Parameter | Type | Passing |
|---|---|---|
argSectionName | string | value |
argValueName | string | value |
argValue | string | value |
Returns: nothing (void)
The section name is the targetted page in the system wide preferences dialog.
Examples: Ciiva, Extension_Preference, Extension_SupplierPreference
Returned by
IOptionsManager.GetOptionsWriter, IOptionsManager.GetOptionsWriter_ForIniFile, Utils.ServerOptionsWriter
Accepted by
IReportOutputOptions.Export_ToOptionsWriter, IReportOutputTransformation.Export_ToOptionsWriter, IVcsDesignVault.SaveToIni, ISch_JunctionConvertSettings.Export_ToIniFile
Examples
Used in the SDK examples: Ciiva, Extension_Preference, Extension_SchPreference, Extension_SupplierPreference.