Class LaconicConfiguration
Provides implementation of configuration based on Laconic content format
Implements
Inherited Members
Namespace: Azos.Conf
Assembly: Azos.dll
Syntax
[Serializable]
public class LaconicConfiguration : FileConfiguration, ICloneable
Examples
Example Laconic Configuration Content:
azos //comments are allowed { log-root=$"c:\azos" log-csv="Azos.Log.Destinations.CSVFileDestination, Azos" debug-default-action="Log,Throw"
log { name="Logger"
destination { type=$(/$log-csv) name="WinFormsTest Log"//strings in dblquotes path=$(/$log-root) name-time-format='yyyyMMdd'//strings in snglquotes generate-failover-msg=false } } /* multiline comments data-store {type="Azos.RecordModel.DataAccess.MongoDB.MongoDBModelDataStore, Azos.MongoDB" connect-string="mongodb://localhost" db-name="test"} */ }
Constructors
LaconicConfiguration()
Creates an instance of a new configuration not bound to any laconfig file
Declaration
public LaconicConfiguration()
LaconicConfiguration(String)
Creates an isntance of the new configuration and reads contents from a laconfig file
Declaration
public LaconicConfiguration(string filename)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename |
Methods
CreateFromString(String)
Creates an instance of configuration initialized from laconfig passed as string
Declaration
public static LaconicConfiguration CreateFromString(string content)
Parameters
Type | Name | Description |
---|---|---|
System.String | content |
Returns
Type | Description |
---|---|
LaconicConfiguration |
Refresh()
Declaration
public override void Refresh()
Overrides
Save()
Declaration
public override void Save()
Overrides
SaveAs(String)
Saves configuration into a file
Declaration
public override void SaveAs(string filename)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename |
Overrides
SaveAs(String, LaconfigWritingOptions)
Saves configuration into a file
Declaration
public void SaveAs(string filename, LaconfigWritingOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename | |
LaconfigWritingOptions | options |
SaveToString(LaconfigWritingOptions)
Saves laconic configuration into string in Laconfig format and returns it
Declaration
public string SaveToString(LaconfigWritingOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
LaconfigWritingOptions | options |
Returns
Type | Description |
---|---|
System.String |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |