Class IntStringDictionary
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 = "IntStringDictionary", ItemName = "IntStringKeyValuePair", KeyName = "Key", ValueName = "Value", Namespace = "http://www.superoffice.net/ws/crm/NetServer/10.3.0.0")]
public class IntStringDictionary : Dictionary<int, string>, IDictionary<int, string>, ICollection<KeyValuePair<int, string>>, IDictionary, ICollection, IReadOnlyDictionary<int, string>, IReadOnlyCollection<KeyValuePair<int, string>>, IEnumerable<KeyValuePair<int, 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
IntStringDictionary()
Default constructor
Declaration
public IntStringDictionary()
Remarks
Serializes a dictionary to and from XML. Used as part of the data-carriers.
IntStringDictionary(Dictionary<int, string>)
Make a copy of a generic string dictionary
Declaration
public IntStringDictionary(Dictionary<int, string> source)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<int, string> | source |
Remarks
Serializes a dictionary to and from XML. Used as part of the data-carriers.
IntStringDictionary(IEnumerable<int>, IEnumerable<string>)
Make a string dictionary from two string arrays
Declaration
public IntStringDictionary(IEnumerable<int> keys, IEnumerable<string> values)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<int> | keys | |
IEnumerable<string> | values |
Remarks
Serializes a dictionary to and from XML. Used as part of the data-carriers.
IntStringDictionary(int)
Serializable dictionary. This class works as a regular dictionary. The only restriction is that the string is a value type
Declaration
public IntStringDictionary(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>
IntStringDictionary(SerializationInfo, StreamingContext)
Initializes a new instance with serialized data.
Declaration
public IntStringDictionary(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<int, string>)
Serializable dictionary. This class works as a regular dictionary. The only restriction is that the string is a value type
Declaration
public static IntStringDictionary FromDictionary(Dictionary<int, string> input)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<int, string> | input |
Returns
Type | Description |
---|---|
IntStringDictionary |
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>