asp.net.ph

ICustomFormatter Interface

System Namespace


Defines a method that supports custom, user-defined formatting of the value of an object.

ICustomFormatter Interface Members

Collapse   Methods

Visibility Name Parameters Return Type
public Format ( String format , Object arg , IFormatProvider formatProvider ) String

Remarks

When this interface is implemented by a reference or value type, the Format method returns a custom-formatted string representation of an object's value.

Use this interface, and the IFormatProvider interface, to supersede the support supplied in .NET Framework formatting methods that honor an IFormatProvider parameter. For example, use this interface to provide custom formatting of the value of an object by the String.Format or Int32.ToString methods.

Derive a class that implements the IFormatProvider interface and its GetFormat method. Specify that derived class for the IFormatProvider parameter of the method you want to supersede. Your implementation of the GetFormat method should return a format object that implements the ICustomFormatter interface. The .NET Framework method will then use your custom formatting instead of its own.

See Also

IFormatProvider Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph