IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
LabexUtilities.SettingsReader Class Reference

Provides functionality for retrieving settings from various sources such as application settings file or PADO server configuration file. More...

+ Collaboration diagram for LabexUtilities.SettingsReader:

Public Types

enum  SettingSource { SettingSource.Unknown = 0, SettingSource.AppConfig, SettingSource.PadoServer }
 

Public Member Functions

string GetSetting (string settingname)
 Retrieves the specified setting from the current settings source. More...
 
bool GetBooleanSetting (string settingname)
 Retrieves the specified boolean setting from the current settings source. More...
 
long GetIntegerSetting (string settingname)
 Retrieves the specified integer setting from the current settings source. If the specific setting is not specified in the configuration then 0 is returned. More...
 
long GetIntegerSetting (string settingname, long defaultvalue)
 Retrieves the specified integer setting from the current settings source. More...
 
string GetSettingAppConfig (string settingname)
 
bool GetBooleanSettingAppConfig (string settingname)
 
string GetSettingPadoServer (Premisa.PadoInterfaces.itfPadoServer server, string settingname)
 Retrieves the specified setting from the PADO Server's connfiguration file. More...
 
bool GetBooleanSettingPadoServer (Premisa.PadoInterfaces.itfPadoServer server, string settingname)
 Retrieves the specified boolean setting from the PADO Server's connfiguration file. More...
 
string GetSettingPadoServer (Premisa.PadoServerClasses.clsPadoObjectManager om, string settingname)
 Retrieves the specified setting from the PADO Server's connfiguration file. More...
 
bool GetBooleanSettingPadoServer (Premisa.PadoServerClasses.clsPadoObjectManager om, string settingname)
 Retrieves the specified boolean setting from the PADO Server's connfiguration file. More...
 

Public Attributes

object lockobj = new object()
 
bool ExpandEnvironmentVariables = true
 

Protected Member Functions

void SetSourceAppconfig ()
 Sets the source of settings to application configuration file. Warning: A call to this method and subsequent reading operations must be enclosed in a lock block, more specifically in "lock (lockobj) { .. }". More...
 
void SetSourcePadoServer (Premisa.PadoInterfaces.itfPadoServer padoserver)
 Sets the source of settings to the Pado Server configuration file. Warning: A call to this method and subsequent reading operations must be enclosed in a lock block, more specifically in "lock (lockobj) { .. }". More...
 
void SetSourcePadoServer (Premisa.PadoServerClasses.clsPadoObjectManager om)
 Sets the source of settings to the Pado Server configuration file. Warning: A call to this method and subsequent reading operations must be enclosed in a lock block, more specifically in "lock (lockobj) { .. }". More...
 

Protected Attributes

SettingSource Source = SettingSource.Unknown
 

Private Member Functions

bool ToBoolean (string strsetting)
 Converts a string representation of a boolean setting to boolean. Strings "true", "yes" and "on" (regardless of capitalization) or non-zero integer representations result to true, anything else (including null or empty string) result in false. More...
 
long ToInt (string strsetting)
 Converts a string representation of an integer setting to an integer value. If the setting is not defined then 0 is returned. More...
 
long ToInt (string strsetting, long defaultvalue)
 Converts a string representation of an integer setting to an integer value. More...
 

Private Attributes

Premisa.PadoInterfaces.itfPadoServer PadoServer = null
 

Detailed Description

Provides functionality for retrieving settings from various sources such as application settings file or PADO server configuration file.

Member Enumeration Documentation

Enumerator
Unknown 
AppConfig 
PadoServer 

Member Function Documentation

bool LabexUtilities.SettingsReader.ToBoolean ( string  strsetting)
inlineprivate

Converts a string representation of a boolean setting to boolean. Strings "true", "yes" and "on" (regardless of capitalization) or non-zero integer representations result to true, anything else (including null or empty string) result in false.

Parameters
strsettingString representation of the specific setting.
Returns
Boolean value corresponding to the setting.

Referenced by LabexUtilities.SettingsReader.GetBooleanSetting(), LabexUtilities.SettingsReader.GetBooleanSettingAppConfig(), and LabexUtilities.SettingsReader.GetBooleanSettingPadoServer().

long LabexUtilities.SettingsReader.ToInt ( string  strsetting)
inlineprivate

Converts a string representation of an integer setting to an integer value. If the setting is not defined then 0 is returned.

Parameters
strsettingString representation of the specific setting.
Returns
Long integer value corresponding to the setting.

Referenced by LabexUtilities.SettingsReader.GetIntegerSetting().

long LabexUtilities.SettingsReader.ToInt ( string  strsetting,
long  defaultvalue 
)
inlineprivate

Converts a string representation of an integer setting to an integer value.

Parameters
strsettingString representation of the specific setting.
defaultvalueDefault value returned in the case that the setting is not defined.
Returns
Long integer value corresponding to the setting.
void LabexUtilities.SettingsReader.SetSourceAppconfig ( )
inlineprotected

Sets the source of settings to application configuration file. Warning: A call to this method and subsequent reading operations must be enclosed in a lock block, more specifically in "lock (lockobj) { .. }".

void LabexUtilities.SettingsReader.SetSourcePadoServer ( Premisa.PadoInterfaces.itfPadoServer  padoserver)
inlineprotected

Sets the source of settings to the Pado Server configuration file. Warning: A call to this method and subsequent reading operations must be enclosed in a lock block, more specifically in "lock (lockobj) { .. }".

Parameters
padoserverReference to the Pado Server through wihich the server settings can be accessed.

References LabexUtilities.SettingsReader.PadoServer.

void LabexUtilities.SettingsReader.SetSourcePadoServer ( Premisa.PadoServerClasses.clsPadoObjectManager  om)
inlineprotected

Sets the source of settings to the Pado Server configuration file. Warning: A call to this method and subsequent reading operations must be enclosed in a lock block, more specifically in "lock (lockobj) { .. }".

Parameters
omReference to the Pado ObjectManager through wihich the server settings can be accessed.

References LabexUtilities.SettingsReader.PadoServer.

string LabexUtilities.SettingsReader.GetSetting ( string  settingname)
inline
bool LabexUtilities.SettingsReader.GetBooleanSetting ( string  settingname)
inline

Retrieves the specified boolean setting from the current settings source.

Parameters
settingnameSetting name.

References LabexUtilities.SettingsReader.GetSetting(), and LabexUtilities.SettingsReader.ToBoolean().

long LabexUtilities.SettingsReader.GetIntegerSetting ( string  settingname)
inline

Retrieves the specified integer setting from the current settings source. If the specific setting is not specified in the configuration then 0 is returned.

Parameters
settingnameSetting name.

References LabexUtilities.SettingsReader.GetSetting(), and LabexUtilities.SettingsReader.ToInt().

long LabexUtilities.SettingsReader.GetIntegerSetting ( string  settingname,
long  defaultvalue 
)
inline

Retrieves the specified integer setting from the current settings source.

Parameters
settingnameSetting name.
defaultvalueValue returned in the case that the correspondig setting is not defined.

References LabexUtilities.SettingsReader.GetSetting(), and LabexUtilities.SettingsReader.ToInt().

string LabexUtilities.SettingsReader.GetSettingAppConfig ( string  settingname)
inline
bool LabexUtilities.SettingsReader.GetBooleanSettingAppConfig ( string  settingname)
inline
string LabexUtilities.SettingsReader.GetSettingPadoServer ( Premisa.PadoInterfaces.itfPadoServer  server,
string  settingname 
)
inline

Retrieves the specified setting from the PADO Server's connfiguration file.

Parameters
serverPado server whose setting file defines the settings.
settingnameSetting name.

Referenced by LabexUtilities.SettingsReader.GetBooleanSettingPadoServer(), LabexUtilities.SettingsReader.GetSetting(), and LabexUtilities.SettingsReader.GetSettingPadoServer().

bool LabexUtilities.SettingsReader.GetBooleanSettingPadoServer ( Premisa.PadoInterfaces.itfPadoServer  server,
string  settingname 
)
inline

Retrieves the specified boolean setting from the PADO Server's connfiguration file.

Parameters
om
settingname

References LabexUtilities.SettingsReader.GetSettingPadoServer(), and LabexUtilities.SettingsReader.ToBoolean().

Referenced by LabexUtilities.SettingsReader.GetBooleanSettingPadoServer().

string LabexUtilities.SettingsReader.GetSettingPadoServer ( Premisa.PadoServerClasses.clsPadoObjectManager  om,
string  settingname 
)
inline

Retrieves the specified setting from the PADO Server's connfiguration file.

References LabexUtilities.SettingsReader.GetSettingPadoServer().

bool LabexUtilities.SettingsReader.GetBooleanSettingPadoServer ( Premisa.PadoServerClasses.clsPadoObjectManager  om,
string  settingname 
)
inline

Retrieves the specified boolean setting from the PADO Server's connfiguration file.

References LabexUtilities.SettingsReader.GetBooleanSettingPadoServer().

Member Data Documentation

object LabexUtilities.SettingsReader.lockobj = new object()
bool LabexUtilities.SettingsReader.ExpandEnvironmentVariables = true
SettingSource LabexUtilities.SettingsReader.Source = SettingSource.Unknown
protected
Premisa.PadoInterfaces.itfPadoServer LabexUtilities.SettingsReader.PadoServer = null
private

The documentation for this class was generated from the following file: