Class StringDictionary
Serializable dictionary. This class works as a regular dictionary. The only restriction is that the string is a value type
Implements
Inherited Members
Namespace: SuperOffice.CRM.Services
Assembly: SoCore.dll
Syntax
[CollectionDataContract(Name = "StringDictionary", ItemName = "StringKeyValuePair", KeyName = "Key", ValueName = "Value", Namespace = "http://www.superoffice.net/ws/crm/NetServer/10.3.0.0")]
public class StringDictionary : Dictionary<string, string>, IDictionary<string, string>, ICollection<KeyValuePair<string, string>>, IDictionary, ICollection, IReadOnlyDictionary<string, string>, IReadOnlyCollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IEnumerable, ISerializable, IDeserializationCallback
Remarks
Serializes a dictionary to and from XML. Used as part of the data-carriers.
Examples
StringDictionary dict = new StringDictionary();
dict["foo"] = "bar";
dict["baz"] = "quux";
dict.WriteXml( xmlWriter );
results in XML that looks like this:
<StringDictionary>
<StringKeyValuePair>
<Key>foo</Key><Value>bar</Value>
</StringKeyValuePair>
<StringKeyValuePair>
<Key>baz</Key><Value>quux</Value>
</StringKeyValuePair>
</StringDictionary>
Constructors
StringDictionary()
Default constructor
Declaration
public StringDictionary()
Remarks
Serializes a dictionary to and from XML. Used as part of the data-carriers.
StringDictionary(Dictionary<string, string>)
Make a copy of a generic string dictionary
Declaration
public StringDictionary(Dictionary<string, string> source)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<string, string> | source |
Remarks
Serializes a dictionary to and from XML. Used as part of the data-carriers.
StringDictionary(IEnumerable<string>, IEnumerable<string>)
Make a string dictionary from two string arrays
Declaration
public StringDictionary(IEnumerable<string> keys, IEnumerable<string> values)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | keys | |
IEnumerable<string> | values |
Remarks
Serializes a dictionary to and from XML. Used as part of the data-carriers.
StringDictionary(int)
Serializable dictionary. This class works as a regular dictionary. The only restriction is that the string is a value type
Declaration
public StringDictionary(int capacity)
Parameters
Type | Name | Description |
---|---|---|
int | capacity |
Remarks
Serializes a dictionary to and from XML. Used as part of the data-carriers.
Examples
StringDictionary dict = new StringDictionary();
dict["foo"] = "bar";
dict["baz"] = "quux";
dict.WriteXml( xmlWriter );
results in XML that looks like this:
<StringDictionary>
<StringKeyValuePair>
<Key>foo</Key><Value>bar</Value>
</StringKeyValuePair>
<StringKeyValuePair>
<Key>baz</Key><Value>quux</Value>
</StringKeyValuePair>
</StringDictionary>
StringDictionary(SerializationInfo, StreamingContext)
Initializes a new instance with serialized data.
Declaration
public StringDictionary(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | Contains the information to de-serialize |
StreamingContext | context | Context |
Remarks
Serializes a dictionary to and from XML. Used as part of the data-carriers.
Methods
FromDictionary(Dictionary<string, string>)
Serializable dictionary. This class works as a regular dictionary. The only restriction is that the string is a value type
Declaration
public static StringDictionary FromDictionary(Dictionary<string, string> input)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<string, string> | input |
Returns
Type | Description |
---|---|
StringDictionary |
Remarks
Serializes a dictionary to and from XML. Used as part of the data-carriers.
Examples
StringDictionary dict = new StringDictionary();
dict["foo"] = "bar";
dict["baz"] = "quux";
dict.WriteXml( xmlWriter );
results in XML that looks like this:
<StringDictionary>
<StringKeyValuePair>
<Key>foo</Key><Value>bar</Value>
</StringKeyValuePair>
<StringKeyValuePair>
<Key>baz</Key><Value>quux</Value>
</StringKeyValuePair>
</StringDictionary>
ToString(string)
Serializable dictionary. This class works as a regular dictionary. The only restriction is that the string is a value type
Declaration
public string ToString(string prefix)
Parameters
Type | Name | Description |
---|---|---|
string | prefix |
Returns
Type | Description |
---|---|
string |
Remarks
Serializes a dictionary to and from XML. Used as part of the data-carriers.
Examples
StringDictionary dict = new StringDictionary();
dict["foo"] = "bar";
dict["baz"] = "quux";
dict.WriteXml( xmlWriter );
results in XML that looks like this:
<StringDictionary>
<StringKeyValuePair>
<Key>foo</Key><Value>bar</Value>
</StringKeyValuePair>
<StringKeyValuePair>
<Key>baz</Key><Value>quux</Value>
</StringKeyValuePair>
</StringDictionary>