Hide menu
Loading...
Searching...
No Matches

The Settings class defines a container of global Manufacturing Toolkit parameters. More...

Inherits global.SystemIDisposable.

Public Types

enum  Id { ConcurrentMode , UserDefined = 10000 }
 Describes values used to identify Manufacturing Toolkit settings. More...
 

Public Member Functions

 Settings (global::System.IntPtr cPtr, bool cMemoryOwn)
 
void Dispose ()
 
void SetValue (cadex.Utilities.Settings.Id theId, int theVal)
 Sets integer parameter value.
 
void SetValue (cadex.Utilities.Settings.Id theId, double theVal)
 Sets double parameter value.
 
void SetValue (cadex.Utilities.Settings.Id theId, bool theVal)
 Sets double parameter value.
 
void SetValue (cadex.Utilities.Settings.Id theId, cadex.UTF16String theVal)
 Sets double parameter value.
 
int IntValue (cadex.Utilities.Settings.Id theId, int theDefaultVal)
 Returns integer parameter value.
 
double DoubleValue (cadex.Utilities.Settings.Id theId, double theDefaultVal)
 Returns double parameter value.
 
bool BoolValue (cadex.Utilities.Settings.Id theId, bool theDefaultVal)
 Returns boolean parameter value.
 
cadex.UTF16String StringValue (cadex.Utilities.Settings.Id theId, cadex.UTF16String theDefaultVal)
 Returns a string value for the parameter with theId which has already been registered with SetValue().
 

Static Public Member Functions

static cadex.Utilities.Settings Instance ()
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Detailed Description

The Settings class defines a container of global Manufacturing Toolkit parameters.

The settings class is a singleton; there is only one object, which is returned by Instance().

Parameters can be set with SetValue() and retrieved with respective Value() methods.

Settings support several types of parameters:

Each parameter is given an id specified by the Settings.Id enumeration. To extend with your own id's make sure you use UserDefined value and greater.

Warning
Do not rely on preservation of id's from between Manufacturing Toolkit versions (except UserDefined value). As new ids appear they may be inserted between existing ones.
using namespace Utilities;
auto& aSettings = Settings::Instance();
auto aUserValueId = Settings::Id (static_cast<int> (Settings::Id::UserDefined) + 2);
aSettings.SetValue (aUserValueId, 0.5);
bool anIsConcurrent = aSettings.BoolValue (Settings::Id::ConcurrentMode, true);
Id
Describes values used to identify Manufacturing Toolkit settings.
Definition Settings.cs:161

Member Enumeration Documentation

◆ Id

Describes values used to identify Manufacturing Toolkit settings.

Member Function Documentation

◆ BoolValue()

bool cadex.Utilities.Settings.BoolValue ( cadex.Utilities.Settings.Id theId,
bool theDefaultVal )
inline

Returns boolean parameter value.

◆ DoubleValue()

double cadex.Utilities.Settings.DoubleValue ( cadex.Utilities.Settings.Id theId,
double theDefaultVal )
inline

Returns double parameter value.

◆ IntValue()

int cadex.Utilities.Settings.IntValue ( cadex.Utilities.Settings.Id theId,
int theDefaultVal )
inline

Returns integer parameter value.

◆ SetValue() [1/4]

void cadex.Utilities.Settings.SetValue ( cadex.Utilities.Settings.Id theId,
bool theVal )
inline

Sets double parameter value.

Sets boolean parameter value. Sets string parameter value.

◆ SetValue() [2/4]

void cadex.Utilities.Settings.SetValue ( cadex.Utilities.Settings.Id theId,
cadex.UTF16String theVal )
inline

Sets double parameter value.

Sets boolean parameter value. Sets string parameter value.

◆ SetValue() [3/4]

void cadex.Utilities.Settings.SetValue ( cadex.Utilities.Settings.Id theId,
double theVal )
inline

Sets double parameter value.

Sets boolean parameter value. Sets string parameter value.

◆ SetValue() [4/4]

void cadex.Utilities.Settings.SetValue ( cadex.Utilities.Settings.Id theId,
int theVal )
inline

Sets integer parameter value.

◆ StringValue()

cadex.UTF16String cadex.Utilities.Settings.StringValue ( cadex.Utilities.Settings.Id theId,
cadex.UTF16String theDefaultVal )
inline

Returns a string value for the parameter with theId which has already been registered with SetValue().

If such id has not been registered yet, returns theDefaultValue. Returns string parameter value.