Class JSONConfiguration
Provides implementation of configuration based on a classic JSON content
Implements
System.ICloneable
Inherited Members
Configuration.RunMacro(IConfigSectionNode, String, String, IConfigSectionNode, IMacroRunner, Object)
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)
Namespace: Azos.Conf
Assembly: Azos.dll
Syntax
[Serializable]
public class JSONConfiguration : FileConfiguration, ICloneable
Constructors
JSONConfiguration()
Creates an instance of a new configuration not bound to any JSON file
Declaration
public JSONConfiguration()
JSONConfiguration(String)
Creates an isntance of the new configuration and reads contents from a JSON file
Declaration
public JSONConfiguration(string filename)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename |
Fields
SECTION_VALUE_ATTR
Declaration
public const string SECTION_VALUE_ATTR = "-section-value"
Field Value
Type | Description |
---|---|
System.String |
Methods
CreateFromJSON(String)
Creates an instance of configuration initialized from JSON content passed as string
Declaration
public static JSONConfiguration CreateFromJSON(string content)
Parameters
Type | Name | Description |
---|---|---|
System.String | content |
Returns
Type | Description |
---|---|
JSONConfiguration |
Refresh()
Declaration
public override void Refresh()
Overrides
Save()
Declaration
public override void Save()
Overrides
SaveAs(String)
Saves configuration into a JSON file
Declaration
public override void SaveAs(string filename)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename |
Overrides
SaveAs(String, JSONWritingOptions, Encoding)
Saves configuration into a JSON file
Declaration
public void SaveAs(string filename, JSONWritingOptions options = null, Encoding encoding = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename | |
JSONWritingOptions | options | |
System.Text.Encoding | encoding |
SaveToString(JSONWritingOptions)
Saves JSON configuration to string
Declaration
public string SaveToString(JSONWritingOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
JSONWritingOptions | options |
Returns
Type | Description |
---|---|
System.String |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
System.Object.ToString()
Implements
System.ICloneable