Class DefaultMacroRunner
Provides default implementation for configuration variable macros. NOTE: When serialized a new instance is created which will not equal by reference to static.Instance property
Inheritance
System.Object
DefaultMacroRunner
Implements
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()
Namespace: Azos.Conf
Assembly: Azos.dll
Syntax
[Serializable]
public class DefaultMacroRunner : IMacroRunner
Fields
AS_PREFIX
Declaration
public const string AS_PREFIX = "as-"
Field Value
Type | Description |
---|---|
System.String |
Properties
Instance
Returns a singleton class instance
Declaration
public static DefaultMacroRunner Instance { get; }
Property Value
Type | Description |
---|---|
DefaultMacroRunner |
Methods
GetValueAs(String, String, String, String)
Returns a string value converted to desired type with optional default and format
Declaration
public static string GetValueAs(string value, string type, string dflt = null, string fmt = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | String value to convert |
System.String | type | A type to convert string value into i.e. "decimal" |
System.String | dflt | Default value which is used when conversion of original value can not be made |
System.String | fmt | Format string that formats the converted value. Example: 'Goods: {0}'. The '0' index is the value |
Returns
Type | Description |
---|---|
System.String | Converted value to desired type then back to string, using optional formatting and default if conversion did not succeed |
Run(IConfigSectionNode, String, String, IConfigSectionNode, Object)
Declaration
public virtual string Run(IConfigSectionNode node, string inputValue, string macroName, IConfigSectionNode macroParams, object context = null)
Parameters
Type | Name | Description |
---|---|---|
IConfigSectionNode | node | |
System.String | inputValue | |
System.String | macroName | |
IConfigSectionNode | macroParams | |
System.Object | context |
Returns
Type | Description |
---|---|
System.String |