Settings nodes
Last updated
Was this helpful?
Last updated
Was this helpful?
Settings nodes are the intermediate representation of configuration data and one of the core concepts of the library. Their main purpose is to abstract away various configuration formats (JSON, XML, etc.) so that can be implemented once without regard to the nature of being used.
A settings node is a tree with string keys and string values in its leaf nodes.
produce settings nodes as their primary artifacts.
is the process of converting a settings node to an arbitrary .NET object.
Settings nodes are implemented in the .
Settings nodes are immutable objects.
Despite being a somewhat internal API used directly only in a handful of advanced scenarios, settings nodes are crucial for a solid understanding of how configuration data to objects in C# code via different node types and .
Implementation of a ;
Implementation of a ;
of configuration sources
There are three types of nodes:
Users are not expected to implement custom node types.
Null
node instances represent absence of settings (e.g. a configuration file that does not exist).
Property
Type
Description
Name
string
Node name. Case-insensitive.
Value
string
Children
IEnumerable<ISettingsNode>
this[name]
ISettingsNode
This representation is extensively used on the rest of the pages.
, used to hold data;
, used to represent sequences;
, used to represent objects with named properties.
All node types implement the interface and have following properties:
Node value. Only present in .
Sequence of child nodes in containers: and .
Name-based indexer used to navigate (see ).
All nodes also implement a operation.
All node types implement a JSON-like ToString()
method. Its result may look like this for a sample with two nested :