NumberFormatInfo.GetInstance(IFormatProvider) Метод
Определение
Возвращает класс NumberFormatInfo, связанный с заданным IFormatProvider.Gets the NumberFormatInfo associated with the specified IFormatProvider.
public:
static System::Globalization::NumberFormatInfo ^ GetInstance(IFormatProvider ^ formatProvider);
public static System.Globalization.NumberFormatInfo GetInstance (IFormatProvider formatProvider);
static member GetInstance : IFormatProvider -> System.Globalization.NumberFormatInfo
Public Shared Function GetInstance (formatProvider As IFormatProvider) As NumberFormatInfo
Параметры
- formatProvider
- IFormatProvider
Объект IFormatProvider, используемый для получения NumberFormatInfo.The IFormatProvider used to get the NumberFormatInfo.
- или --or-
Значениеnull
, чтобы получить CurrentInfo.null
to get CurrentInfo.
Возвраты
Класс NumberFormatInfo, связанный с заданным классом IFormatProvider.The NumberFormatInfo associated with the specified IFormatProvider.
Комментарии
Этот метод использует IFormatProvider.GetFormat formatProvider
метод использования NumberFormatInfo в качестве параметра типа.This method uses the IFormatProvider.GetFormat method of formatProvider
using NumberFormatInfo as the Type parameter. Если formatProvider
имеет null
значение или IFormatProvider.GetFormat возвращает CurrentInfo, этот null
метод возвращает.If formatProvider
is null
or if IFormatProvider.GetFormat returns null
, this method returns CurrentInfo.
Приложение получает NumberFormatInfo объект для определенного языка и региональных параметров с помощью одного из следующих методов:Your application gets a NumberFormatInfo object for a specific culture using one of the following methods:
CultureInfo.NumberFormat Через свойство.Through the CultureInfo.NumberFormat property.
Через метод, где
provider
— CultureInfo. GetInstanceThrough the GetInstance method whereprovider
is a CultureInfo.
NumberFormatInfo Объект создается только для инвариантного языка и региональных параметров или для конкретных языков и региональных параметров, а не для нейтральных языков и региональных параметров.A NumberFormatInfo object is created only for the invariant culture or for specific cultures, not for neutral cultures. Дополнительные сведения о инвариантных региональных параметрах, конкретных культурах и нейтральных культурах см CultureInfo . в разделе класс.For more information about the invariant culture, specific cultures, and neutral cultures, see the CultureInfo class.