Show / Hide Table of Contents

Class StringObjectDictionary

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

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

StringObjectDictionary()

Default constructor

Declaration
public StringObjectDictionary()
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>

StringObjectDictionary(Dictionary<String, Object>)

Make a copy of a generic string dictionary

Declaration
public StringObjectDictionary(Dictionary<string, object> source)
Parameters
Type Name Description
Dictionary<String, Object> 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>

StringObjectDictionary(IEnumerable<String>, IEnumerable<Object>)

Make a string dictionary from two string arrays

Declaration
public StringObjectDictionary(IEnumerable<string> keys, IEnumerable<object> values)
Parameters
Type Name Description
IEnumerable<String> keys
IEnumerable<Object> 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>

StringObjectDictionary(Int32)

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

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

StringObjectDictionary(SerializationInfo, StreamingContext)

Initializes a new instance with serialized data.

Declaration
public StringObjectDictionary(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, Object>)

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

Declaration
public static StringObjectDictionary FromDictionary(Dictionary<string, object> input)
Parameters
Type Name Description
Dictionary<String, Object> input
Returns
Type Description
StringObjectDictionary
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