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.
 

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)
 
void SetValue (cadex.Utilities.Settings.Id theId, bool theVal)
 
void SetValue (cadex.Utilities.Settings.Id theId, cadex.UTF16String theVal)
 
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 string parameter value.
 

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 Function Documentation

◆ SetValue() [1/3]

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/3]

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/3]

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.

◆ StringValue()

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

Returns string parameter value.

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.