Class KeyValueCollection
This key value collection is used to serialize a dictionary into JSON format and back.
Inheritance
System.Object
KeyValueCollection
Implements
System.Runtime.Serialization.ISerializable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Terrasoft.Common
Assembly: Terrasoft.Common.dll
Syntax
[Serializable]
public sealed class KeyValueCollection : ISerializable
Constructors
KeyValueCollection()
Initializes a new instance of the KeyValueCollection class.
Declaration
public KeyValueCollection()
KeyValueCollection(Dictionary<String, Object>)
Initializes a new instance of the KeyValueCollection class.
Declaration
public KeyValueCollection(Dictionary<string, object> dictionary)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> | dictionary |
Properties
Count
Gets the number of key/value pairs contained in the KeyValueCollection .
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of key/value pairs contained in the KeyValueCollection. |
Item[String]
Gets or sets the System.String with the specified key.
Declaration
public object this[string key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
Property Value
Type | Description |
---|---|
System.Object |
Methods
Add(String, Object)
Adds the item with the specified key.
Declaration
public void Add(string key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | |
System.Object | value |
Explicit Interface Implementations
ISerializable.GetObjectData(SerializationInfo, StreamingContext)
Populates a SerializationInfo with the data needed to serialize the target object.
Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | |
System.Runtime.Serialization.StreamingContext | context |
Implements
System.Runtime.Serialization.ISerializable