Declares a custom type formatter.
Namespace:
MbUnit.FrameworkAssembly: MbUnit (in MbUnit.dll) Version: 3.3.0.0 (3.3.459.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
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
System..::.Object
System..::.Attribute
Gallio.Framework.Pattern..::.PatternAttribute
Gallio.Framework.Pattern..::.DecoratorPatternAttribute
MbUnit.Framework..::.ExtensionPointPatternAttribute
MbUnit.Framework..::.FormatterAttribute
System..::.Attribute
Gallio.Framework.Pattern..::.PatternAttribute
Gallio.Framework.Pattern..::.DecoratorPatternAttribute
MbUnit.Framework..::.ExtensionPointPatternAttribute
MbUnit.Framework..::.FormatterAttribute
