Declares a custom type converter.

Namespace:  MbUnit.Framework
Assembly:  MbUnit (in MbUnit.dll) Version: 3.3.0.0 (3.3.459.0)

Syntax

C#
public class ConverterAttribute : ExtensionPointPatternAttribute
Visual Basic (Declaration)
Public Class ConverterAttribute _
	Inherits ExtensionPointPatternAttribute

Remarks

That attribute must be used on a static method taking one single parameter of the source type, and returning a value of the target type.

Examples

CopyC#
public class MyConverters
{
    [Converter]
    public static Pen KnownColorToPen(KnownColor knownColor)
    {
        return new Pen(Color.FromKnownColor(knownColor));
    }
}

Inheritance Hierarchy

See Also