Declares a custom type formatter.

Namespace:  MbUnit.Framework
Assembly:  MbUnit (in MbUnit.dll) Version: 3.2.0.0 (3.2.528.0)

Syntax

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

Remarks

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

Examples

CopyC#
public class MyFormatters
{
    [Formatter]
    public static string FormatColor(Color color)
    {
        return String.Format("Color: R={0}, G={1}, B{2}, H={3}, L={4}, S={5}", 
            color.R, color.G, color.B, color.GetHue(), color.GetLuminance(), color.GetSaturation());
    }
}

Inheritance Hierarchy

See Also