Duration (Pacific Standard Time):
To (Pacific Standard Time):
Impact:
  • None
User Action:
  • None
 Collapse AllExpand All      Code: All Code: Multiple Code: Visual Basic Code: C# Code: Visual C++ Code: F# Code: JScript 

IFormatProvider Interface

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Provides a mechanism for retrieving an object to control formatting.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)
Public Interface IFormatProvider

The IFormatProvider type exposes the following members.

  Name Description
Public method GetFormat Returns an object that provides formatting services for the specified type.
Top

The IFormatProvider interface supplies an object that provides formatting information for formatting and parsing operations. Formatting operations convert the value of a type to the string representation of that value. Typical formatting methods are the ToString methods of a type, as well as Format. Parsing operations convert the string representation of a value to a type with that value. Typical parsing methods are Parse and TryParse.

The IFormatProvider interface consists of a single method, IFormatProvider..::..GetFormat. GetFormat is a callback method: The parsing or formatting method calls it and passes it a Type object that represents the type of object that the formatting or parsing method expects will provide formatting information. The GetFormat method is responsible for returning an object of that type.