Show / Hide Table of Contents

Class IntStringDictionary

Serializable dictionary. This class works as a regular dictionary. The only restriction is that the string is a value type

Inheritance
Object
IntStringDictionary
Namespace: SuperOffice.CRM.Services
Assembly: SoCore.dll
Syntax
public class IntStringDictionary : Dictionary<int, 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

IntStringDictionary()

Default constructor

Declaration
public 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>

IntStringDictionary(Dictionary<Int32, String>)

Make a copy of a generic string dictionary

Declaration
public IntStringDictionary(Dictionary<int, string> source)
Parameters
Type Name Description
Dictionary<Int32, 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>

IntStringDictionary(IEnumerable<Int32>, IEnumerable<String>)

Make a string dictionary from two string arrays

Declaration
public IntStringDictionary(IEnumerable<int> keys, IEnumerable<string> values)
Parameters
Type Name Description
IEnumerable<Int32> 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>

IntStringDictionary(Int32)

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
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>

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.

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<Int32, 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<Int32, 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>

Extension Methods

EnumUtil.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top