ApplicationConfiguration Class
Namespace: PTS
Assembly: PTSframework.dll
Runtime configuration accessor.
Syntax
public class ApplicationConfiguration
Inheritance
System.Object
ApplicationConfiguration
Constructors
ApplicationConfiguration()
Initializes a new instance of ApplicationConfiguration
.
Declaration
public ApplicationConfiguration()
Properties
Static
Static instance of runtime configuration.
Declaration
public static ApplicationConfiguration Static { get; }
Property Value
Type | Description |
---|---|
ApplicationConfiguration |
Methods
Read(String)
Reads configuration value for given key.
Declaration
public string Read(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key to look up the value for. |
Returns
Type | Description |
---|---|
System.String | If key exists then its corresponding value, otherwise |
ReadEnum<TEnum>(String)
Reads configuration value for given key casted as enum
.
Declaration
public TEnum? ReadEnum<TEnum>(string key)
where TEnum : struct, Enum
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key to look up the value for. |
Returns
Type | Description |
---|---|
System.Nullable<TEnum> | If key exists then its corresponding value, otherwise |
Type Parameters
Name | Description |
---|---|
TEnum | Type of |
SetProvider(IConfigurationProvider)
Injects the configuration data access provider dependency.
Declaration
public void SetProvider(IConfigurationProvider provider)
Parameters
Type | Name | Description |
---|---|---|
IConfigurationProvider | provider | Service facilitating configuration data access. |
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()