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.

System.Object
  System.Collections.Generic.Dictionary<String,TValue>
    Westwind.Utilities.PropertyBag<TValue>
public class PropertyBag<TValue> : Dictionary<String,TValue>, IXmlSerializable

Class Members

MemberDescription

Constructor

CreateFromXml

Creates an instance of a propertybag from an Xml string

public static PropertyBag CreateFromXml(string xml)

FromXml

Deserializes from an XML string

public bool FromXml(string xml)

GetSchema

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

public sealed XmlSchema GetSchema()

ReadXml

Reads the custom serialized format

public sealed void ReadXml(XmlReader reader)

ToXml

Serializes this dictionary to an XML string

public string ToXml()

WriteXml

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)

Requirements

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

© West Wind Technologies, 1996-2024 • Updated: 06/29/24
Comment or report problem with topic