mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Runtime.InteropServices.ComVisible(true)

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

Typically, the interface is implemented with the interface to customize the behavior of two .NET Framework composite string formatting methods that include an parameter. Specifically, the interface can provide custom formatting of the value of an object passed to the and methods.

Providing a custom representation of an object's value requires that you do the following:

Define a class that implements the interface and its single member, the method.

Define a class that implements the interface and its single member, the method. The method returns an instance of your implementation. Often, a single class implements both and . In that case, the class's GetFormat implementation just returns an instance of itself.

Pass the implementation as the argument of the method or a comparable method.

The .NET Framework method will then use your custom formatting instead of its own.

Defines a method that supports custom formatting of the value of an object.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` ``

  is a callback method. It is called by a method that supports custom formatting, such as or . The implementation is called once for each format item in a composite format string. For example, in the following statement, the method is called three times.

  code reference: System.ICustomFormatter.Class#4

  The parameter is the object in the object list whose zero-based position corresponds to the index of a particular format item.

  The parameter contains a format string, which is the component of a format item. If the format item has no component, the value of is null. If is null, depending on the type of , you may be able to use the default format specification of your choice.

  The parameter is the implementation that provides formatting for . Typically, it is an instance of your implementation. If is null, ignore that parameter.

  Your implementation of the method must include the following functionality so the .NET Framework can provide formatting you do not support. If your format method does not support a format, determine whether the object being formatted implements the interface. If it does, invoke the method of that interface. Otherwise, invoke the default method of the underlying object. The following code illustrates this pattern.

  code reference: System.ICustomFormatter.Class#3

  Converts the value of a specified object to an equivalent string representation using specified format and culture-specific formatting information.

  The string representation of the value of , formatted as specified by and .

  A format string containing formatting specifications. An object to format. An object that supplies format information about the current instance.