Export (0) Print
Expand All

Enum.IFormattable.ToString Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Note: This API is now obsolete.

This method overload is obsolete; use Enum.ToString(String).

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

[ObsoleteAttribute("The provider argument is not used. Please use ToString(String).")]
string IFormattable.ToString(
	string format,
	IFormatProvider provider
)

Parameters

format
Type: System.String

A format specification.

provider
Type: System.IFormatProvider

Return Value

Type: System.String
The string representation of the value of this instance, as specified by format.

Implements

IFormattable.ToString(String, IFormatProvider)

ExceptionCondition
FormatException

format does not contain a valid format specification.

InvalidOperationException

format equals "X", but the enumeration type is unknown.

This member is an explicit interface member implementation. It can be used only when the enumeration instance is cast to an IFormattable interface. The recommended alternative is to call the ToString(String) method.

Portable Class Library

Obsolete (compiler warning) in Portable Class Library

.NET for Windows Store apps

Obsolete (compiler warning) in Windows 8
Show:
© 2014 Microsoft