TomlTable Class
Runtime representation of a TOML table
public sealed class TomlTable : TomlObject, ICollection<KeyValuePair<string, object>>, IDictionary<string, object>, IEnumerable<KeyValuePair<string, object>>, IEnumerableRemarks
This object keep the order of the inserted key=values
- Inheritance
TomlObjectTomlTable- Implements
Nested types
| Name | Description |
|---|---|
| TomlTable.Enumerator | Enumerates the key-value pairs contained in a TomlTable. |
Constructors
| Name | Description |
|---|---|
| TomlTable() | Creates an instance of a TomlTable |
| TomlTable(bool) | Creates an instance of TomlTable. |
TomlTable overloads
TomlTable()
TomlTable.csCreates an instance of a TomlTable
public TomlTable()TomlTable(bool)
TomlTable.csProperties
| Name | Description |
|---|---|
| Count | Gets the number of elements contained in the ICollection<T>. |
| IsReadOnly | Gets a value indicating whether the ICollection<T> is read-only. |
| Keys | Gets a read-only snapshot of the keys, in insertion order. |
| Values | Gets a read-only snapshot of the values, in insertion order. |
Count
TomlTable.csIsReadOnly
TomlTable.csGets a value indicating whether the ICollection<T> is read-only.
public bool IsReadOnly { get; }Property value
Keys
TomlTable.csGets a read-only snapshot of the keys, in insertion order.
public ICollection<string> Keys { get; }Property value
Values
TomlTable.csGets a read-only snapshot of the values, in insertion order.
public ICollection<object> Values { get; }Property value
Indexers
| Name | Description |
|---|---|
| this[string] | Gets or sets the element with the specified key. |
this[string]
TomlTable.csGets or sets the element with the specified key.
Parameters
keystring- The key of the element to get or set.
Property value
Exceptions
ArgumentNullExceptionkeyisnull.KeyNotFoundException- The property is retrieved and
keyis not found. NotSupportedException- The property is set and the
IDictionary<TKey, TValue>is read-only.
Methods
Add(string, object)
TomlTable.csAdds an element with the provided key and value to the IDictionary<TKey, TValue>.
Parameters
keystring- The object to use as the key of the element to add.
valueobject- The object to use as the value of the element to add.
Exceptions
ArgumentNullExceptionkeyisnull.ArgumentException- An element with the same key already exists in the
IDictionary<TKey, TValue>. NotSupportedException- The
IDictionary<TKey, TValue>is read-only.
Clear()
TomlTable.csRemoves all items from the ICollection<T>.
public void Clear()Exceptions
NotSupportedException- The
ICollection<T>is read-only.
ContainsKey(string)
TomlTable.csDetermines whether the IDictionary<TKey, TValue> contains an element with the specified key.
Parameters
keystring- The key to locate in the
IDictionary<TKey, TValue>.
Returns
bool true if the IDictionary<TKey, TValue> contains an element with the key; otherwise, false.
Exceptions
ArgumentNullExceptionkeyisnull.
GetEnumerator()
TomlTable.csReturns an enumerator that iterates through the table.
public TomlTable.Enumerator GetEnumerator()Returns
TomlTable.Enumerator An enumerator for the table.
Remove(string)
TomlTable.csRemoves the element with the specified key from the IDictionary<TKey, TValue>.
Parameters
keystring- The key of the element to remove.
Returns
bool true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original IDictionary<TKey, TValue>.
Exceptions
ArgumentNullExceptionkeyisnull.NotSupportedException- The
IDictionary<TKey, TValue>is read-only.
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Add(KeyValuePair<string, object>)
TomlTable.csvoid ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> item)Parameters
No documentation is available.
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Contains(KeyValuePair<string, object>)
TomlTable.csbool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> item)No documentation is available.
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.CopyTo(KeyValuePair<string, object>[], int)
TomlTable.csvoid ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)Parameters
arrayKeyValuePair<string, object>[]arrayIndexint
No documentation is available.
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Remove(KeyValuePair<string, object>)
TomlTable.csbool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> item)No documentation is available.
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.GetEnumerator()
TomlTable.csIEnumerator<KeyValuePair<string, object>> IEnumerable<KeyValuePair<string, object>>.GetEnumerator()No documentation is available.
System.Collections.IEnumerable.GetEnumerator()
TomlTable.csTryGetValue(string, object)
TomlTable.csGets the value associated with the specified key.
Parameters
keystring- The key whose value to get.
valueobject- When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the
valueparameter. This parameter is passed uninitialized.
Returns
bool true if the object that implements IDictionary<TKey, TValue> contains an element with the specified key; otherwise, false.
Exceptions
ArgumentNullExceptionkeyisnull.