Skip to main content
View as Markdown

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​

MethodReturnsDescription
EraseSectionvoidThis method removes all the option values for the section (targetted page in the system wide preferences dialog).
Flushvoid
WriteBooleanvoidThis 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.
WriteDoublevoidThis 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.
WriteIntegervoidThis 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.
WriteStringvoidThis 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);
ParameterTypePassing
argSectionNamestringvalue

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);
ParameterTypePassing
argSectionNamestringvalue
argValueNamestringvalue
argValueboolvalue

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);
ParameterTypePassing
argSectionNamestringvalue
argValueNamestringvalue
argValuedoublevalue

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);
ParameterTypePassing
argSectionNamestringvalue
argValueNamestringvalue
argValueintvalue

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);
ParameterTypePassing
argSectionNamestringvalue
argValueNamestringvalue
argValuestringvalue

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.