Class PropertyBag<TValue>

Creates a serializable string for generic types that is XML serializable.

Encodes keys as element names and values as simple values with a type attribute that contains an XML type name. Complex names encode the type name with type='___namespace.classname' format followed by a standard xml serialized format. The latter serialization can be slow so it's not recommended to pass complex types if performance is critical.

public class PropertyBag<TValue> : Dictionary<String,TValue>, IXmlSerializable

Class Members




Creates an instance of a propertybag from an Xml string

public static PropertyBag CreateFromXml(string xml)


Deserializes from an XML string

public bool FromXml(string xml)


Not implemented - this means no schema information is passed so this won't work with ASMX/WCF services.

public sealed XmlSchema GetSchema()


Reads the custom serialized format

public sealed void ReadXml(XmlReader reader)


Serializes this dictionary to an XML string

public string ToXml()


Serializes the dictionary to XML. Keys are serialized to element names and values as element values. An xml type attribute is embedded for each serialized element - a .NET type element is embedded for each complex type and prefixed with three underscores.

public sealed void WriteXml(XmlWriter writer)


Namespace: Westwind.Utilities
Assembly: westwind.utilities.dll

© West Wind Technologies, 2019 • Updated: 06/23/19
Comment or report problem with topic