Class Properties
Reads in a java style property file. format is key = value. A # key in the first character of the line denotes a comment
Implements
Inherited Members
Namespace: ivrToolkit.Core.Util
Assembly: ivrToolkit.Core.dll
Syntax
public class Properties : IDisposable
Constructors
| Edit this page View SourceProperties(ILoggerFactory)
Loads the properties from the
Declaration
public Properties(ILoggerFactory loggerFactory)
Parameters
Type | Name | Description |
---|---|---|
ILoggerFactory | loggerFactory | Used for debugging |
Properties(ILoggerFactory, string)
Opens up a java style property file.
Declaration
public Properties(ILoggerFactory loggerFactory, string fullFileName)
Parameters
Type | Name | Description |
---|---|---|
ILoggerFactory | loggerFactory | Used for debugging |
string | fullFileName | The name of the file to open. |
Methods
| Edit this page View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
GetKeyPrefixMatch(string)
Gets a list of property names that matches the prefix. Strips off the prefix from the property names
Declaration
public string[] GetKeyPrefixMatch(string prefix)
Parameters
Type | Name | Description |
---|---|---|
string | prefix | The string to match on. |
Returns
Type | Description |
---|---|
string[] | A string array of parameter names(less the prefix) where the property name begins with the prefix |
GetPairPrefixMatch(string)
Gets a list of key/value pairs where the property name matches the prefix. Strips off the prefix from the keys
Declaration
public KeyValuePair<string, string>[] GetPairPrefixMatch(string prefix)
Parameters
Type | Name | Description |
---|---|---|
string | prefix | The string to match on. |
Returns
Type | Description |
---|---|
KeyValuePair<string, string>[] | A string array of key/value pairs where the property name begins with the prefix |
GetProperty(string)
Gets the string value of a property. Case insensitive.
Declaration
public string GetProperty(string key)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key name to search for |
Returns
Type | Description |
---|---|
string | The value store for the key |
GetProperty(string, string)
Gets the string value of a property. Case insensitive.
Declaration
public string GetProperty(string key, string def)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key name to search for. Case insensitve. |
string | def | The default to be returned if the key was not found. |
Returns
Type | Description |
---|---|
string | The value of the property or the default if the property was not found. |
GetValuePrefixMatch(string)
Gets a list of property values where the key name matches the prefix.
Declaration
public string[] GetValuePrefixMatch(string prefix)
Parameters
Type | Name | Description |
---|---|---|
string | prefix | The string to match on. |
Returns
Type | Description |
---|---|
string[] | A string array of values where the property name begins with the prefix |
SetProperty(string, string)
Declaration
public void SetProperty(string key, string def)
Parameters
Type | Name | Description |
---|---|---|
string | key | |
string | def |
ToBool(string)
converts value to boolean
Declaration
protected bool ToBool(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | the value to convert to bool |
Returns
Type | Description |
---|---|
bool | true if value equals 'true','on' or 'yes'. Otherwise returns false. case insensitive. |