EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

CultureInfo.GetFormat Method

May 11, 2014

Gets an object that defines how to format the specified type.

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

public virtual Object GetFormat(
	Type formatType
)

Parameters

formatType
Type: System.Type
The type to get a formatting object for. This method supports only the NumberFormatInfo and DateTimeFormatInfo types.

Return Value

Type: System.Object
The value of the NumberFormat property, if formatType is a Type object that represents the NumberFormatInfo class. This value is a NumberFormatInfo object that contains numeric formatting information for this CultureInfo object,
-or-
The value of the DateTimeFormat property, if formatType is a Type object that represents the DateTimeFormatInfo class. This value is a DateTimeFormatInfo object that contains date and time formatting information for this CultureInfo object,
-or-
null, if formatType is any other object.

Implements

IFormatProvider.GetFormat(Type)

GetFormat implements IFormatProvider.GetFormat. Typically, this method is not called directly from user code. Instead, it is called by parsing and formatting methods such as Int32.Parse(String, IFormatProvider) or DateTime.ToString(String, IFormatProvider).

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Afficher:
© 2014 Microsoft