Class StringDictionary
Serializable dictionary. This class works as a regular dictionary. The only restriction is that the string is a value type
Namespace: SuperOffice.CRM.Services
Assembly: SoCore.dll
Syntax
public class StringDictionary : Dictionary<string, 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>
Constructors
StringDictionary()
Default constructor
Declaration
public 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>
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.
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(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.
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(Int32)
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 |
---|---|---|
Int32 | 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.
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>
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>