Show / Hide Table of Contents

Class StringDictionary

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

Inheritance
System.Object
StringDictionary
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()

StringDictionary(Dictionary<String, String>)

Make a copy of a generic string dictionary

Declaration
public StringDictionary(Dictionary<string, string> source)
Parameters
Type Name Description
System.Collections.Generic.Dictionary<System.String, System.String> source

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
System.Collections.Generic.IEnumerable<System.String> keys
System.Collections.Generic.IEnumerable<System.String> values

StringDictionary(Int32)

Declaration
public StringDictionary(int capacity)
Parameters
Type Name Description
System.Int32 capacity

StringDictionary(SerializationInfo, StreamingContext)

Initializes a new instance with serialized data.

Declaration
public StringDictionary(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info

Contains the information to de-serialize

System.Runtime.Serialization.StreamingContext context

Context

Methods

FromDictionary(Dictionary<String, String>)

Declaration
public static StringDictionary FromDictionary(Dictionary<string, string> input)
Parameters
Type Name Description
System.Collections.Generic.Dictionary<System.String, System.String> input
Returns
Type Description
StringDictionary

ToString(String)

Declaration
public string ToString(string prefix)
Parameters
Type Name Description
System.String prefix
Returns
Type Description
System.String

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