Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

NameValueConverter Class

Custom TypeConverter implementation for NameValueCollection objects.

For a list of all members of this type, see NameValueConverter Members .


[Visual Basic]
Public Class NameValueConverter
    Inherits TypeConverter
public class NameValueConverter : TypeConverter

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.


Handles conversion from an XML formatted string to a NameValueCollection object (see below for an example of the expected XML format).

This converter must be registered before it will be available. Standard converters in this namespace are automatically registered by the ObjectWrapper class.


Find below some examples of the XML formatted strings that this converter will sucessfully convert. Note that the name of the top level (document) element is quite arbitrary... it is only the content that matters (and which must be in the format <add key="..." value="..."/>. For your continued sanity though, you may wish to standardize on the top level name of 'dictionary' (although you are of course free to not do so).

    <add key="host" value="localhost" />
    <add key="port" value="8080" />

The following example uses a different top level (document) element name, but is equivalent to the first example.

    <add key="host" value="localhost" />
    <add key="port" value="8080" />


Namespace: Spring.Core.TypeConversion

Assembly: Spring.Core (in Spring.Core.dll)

See Also

NameValueConverter Members | Spring.Core.TypeConversion Namespace