Structured variable More...
Inherits DynamicObject, IReflection, IStructure, and IDictionary.
Public Member Functions | |
| TStructure (string Key1, object Value1, string Key2, object Value2, string KeyN, object ValueN) | |
| Constructor of the structure. Number of Key-Value pairs is unlimited. More... | |
| void | AddChild (TStructure NewChild) |
| Add structured subnode to the structure More... | |
| void | AddChild (string Key, object Value) |
| Add new subnode to the structure More... | |
| void | Clear () |
| Clears the content of the structure. More... | |
| TStructure | CreatePath (string Path) |
| Creates complete sub-structure defined by the given path More... | |
| bool | ContainsKey (string Key) |
| Determines whether the structure contains an element with the specified key. More... | |
| bool | Contains (string Key) |
| Returns true, if the given Key exists. The MUST NOT be structured path. If you need to detect if the path exists, use function "ContainsPath" More... | |
| bool | ContainsPath (string Path) |
| Returns true, if the given Path exists. Path can be structured. More... | |
| bool | TryGetValue (string Key, out object Value) |
| Gets the value associated with the specified key. More... | |
| bool | TryGetValueFromPath (string Path, out object Value) |
| Gets the value associated with the specified key. More... | |
| void | Remove (string Key) |
| Removes the value with the specified key from the structure. More... | |
| void | Set (string Path, object Value) |
| Sets the value of subnode. Function creates the subnode, if not exists More... | |
| object | Get (string Path) |
| Returns the value of the subnode at given path More... | |
| object | Get (string Path, object DefaultValue) |
| Returns the value of the subnode at given path. If the path doesn't exists, returns specified default value. More... | |
| override string | ToString () |
| Convert the Structure to the string. Nested structures are not expanded. More... | |
| string | ToString (double MaxLevel) |
| Convert the Structure to the string with given level of expansion More... | |
| TStructure | Clone () |
| Returns deep copy of the structure. Warning: This function will stop the program run, if the structure contains circular reference! More... | |
Properties | |
| int | Count [get] |
| Property 'Count' is not implemented for type 'Structure'. you need number of Key-Value pairs, use Structure.Keys.Count More... | |
| ICollection | Keys [get] |
| Gets a collection containing the keys in the structure More... | |
| ICollection | Values [get] |
| Gets a collection containing the values in the structure More... | |
Structured variable
| TStructure | ( | string | Key1, |
| object | Value1, | ||
| string | Key2, | ||
| object | Value2, | ||
| string | KeyN, | ||
| object | ValueN | ||
| ) |
Constructor of the structure.
Number of Key-Value pairs is unlimited.
| Key1 | Key of the fist value |
| Value1 | First value |
| Key2 | Key of the second value |
| Value2 | Second value |
| KeyN | Key of the Nth value |
| ValueN | Nth value |
| void AddChild | ( | TStructure | NewChild | ) |
Add structured subnode to the structure
| NewChild | Structured subnode |
| void AddChild | ( | string | Key, |
| object | Value | ||
| ) |
Add new subnode to the structure
| Key | String key (name) of the subnode. This key is used to obtain the value from the structure. |
| Value | Value of the subnode |
| void Clear | ( | ) |
Clears the content of the structure.
| TStructure Clone | ( | ) |
Returns deep copy of the structure. Warning: This function will stop the program run, if the structure contains circular reference!
| bool Contains | ( | string | Key | ) |
Returns true, if the given Key exists. The MUST NOT be structured path. If you need to detect if the path exists, use function "ContainsPath"
| Key | Key to be tested. Key MUST NOT be structured path. |
| bool ContainsKey | ( | string | Key | ) |
Determines whether the structure contains an element with the specified key.
| Key | The key to locate in the structure |
| bool ContainsPath | ( | string | Path | ) |
Returns true, if the given Path exists. Path can be structured.
| Path | Path to the subnode |
| TStructure CreatePath | ( | string | Path | ) |
Creates complete sub-structure defined by the given path
| Path | Path to be created |
| object Get | ( | string | Path | ) |
Returns the value of the subnode at given path
| Path | Complete path to the subnode |
| object Get | ( | string | Path, |
| object | DefaultValue | ||
| ) |
Returns the value of the subnode at given path. If the path doesn't exists, returns specified default value.
| Path | Complete path to the subnode |
| DefaultValue | Default value used if the subnode is not found (path not exitst). |
| void Remove | ( | string | Key | ) |
Removes the value with the specified key from the structure.
| Key |
| void Set | ( | string | Path, |
| object | Value | ||
| ) |
Sets the value of subnode. Function creates the subnode, if not exists
| Path | Path of the subnode |
| Value | Value of the subnode |
| override string ToString | ( | ) |
Convert the Structure to the string. Nested structures are not expanded.
| string ToString | ( | double | MaxLevel | ) |
Convert the Structure to the string with given level of expansion
| MaxLevel | Depth of expanded sub-structures and lists |
| bool TryGetValue | ( | string | Key, |
| out object | Value | ||
| ) |
Gets the value associated with the specified key.
| Key | The key of the value to get. |
| Value | When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
| bool TryGetValueFromPath | ( | string | Path, |
| out object | Value | ||
| ) |
Gets the value associated with the specified key.
| Path | The path (including '.' and '[]' to the value to get. |
| Value | When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
|
get |
Property 'Count' is not implemented for type 'Structure'. you need number of Key-Value pairs, use Structure.Keys.Count
|
get |
Gets a collection containing the keys in the structure
|
get |
Gets a collection containing the values in the structure