RegionInfo.IsMetric Propriedade
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Obtém um valor que indica se o país ou a região usa o sistema métrico para medidas.
public:
virtual property bool IsMetric { bool get(); };
public virtual bool IsMetric { get; }
member this.IsMetric : bool
Public Overridable ReadOnly Property IsMetric As Boolean
Valor da propriedade
true
se o país ou a região usar o sistema métrico para medidas; caso contrário, false
.
Exemplos
O exemplo de código a seguir exibe as propriedades da RegionInfo classe .
using namespace System;
using namespace System::Globalization;
int main()
{
// Displays the property values of the RegionInfo for "US".
RegionInfo^ myRI1 = gcnew RegionInfo( "US" );
Console::WriteLine( " Name: {0}", myRI1->Name );
Console::WriteLine( " DisplayName: {0}", myRI1->DisplayName );
Console::WriteLine( " EnglishName: {0}", myRI1->EnglishName );
Console::WriteLine( " IsMetric: {0}", myRI1->IsMetric );
Console::WriteLine( " ThreeLetterISORegionName: {0}", myRI1->ThreeLetterISORegionName );
Console::WriteLine( " ThreeLetterWindowsRegionName: {0}", myRI1->ThreeLetterWindowsRegionName );
Console::WriteLine( " TwoLetterISORegionName: {0}", myRI1->TwoLetterISORegionName );
Console::WriteLine( " CurrencySymbol: {0}", myRI1->CurrencySymbol );
Console::WriteLine( " ISOCurrencySymbol: {0}", myRI1->ISOCurrencySymbol );
}
/*
This code produces the following output.
Name: US
DisplayName: United States
EnglishName: United States
IsMetric: False
ThreeLetterISORegionName: USA
ThreeLetterWindowsRegionName: USA
TwoLetterISORegionName: US
CurrencySymbol: $
ISOCurrencySymbol: USD
*/
using System;
using System.Globalization;
public class SamplesRegionInfo {
public static void Main() {
// Displays the property values of the RegionInfo for "US".
RegionInfo myRI1 = new RegionInfo( "US" );
Console.WriteLine( " Name: {0}", myRI1.Name );
Console.WriteLine( " DisplayName: {0}", myRI1.DisplayName );
Console.WriteLine( " EnglishName: {0}", myRI1.EnglishName );
Console.WriteLine( " IsMetric: {0}", myRI1.IsMetric );
Console.WriteLine( " ThreeLetterISORegionName: {0}", myRI1.ThreeLetterISORegionName );
Console.WriteLine( " ThreeLetterWindowsRegionName: {0}", myRI1.ThreeLetterWindowsRegionName );
Console.WriteLine( " TwoLetterISORegionName: {0}", myRI1.TwoLetterISORegionName );
Console.WriteLine( " CurrencySymbol: {0}", myRI1.CurrencySymbol );
Console.WriteLine( " ISOCurrencySymbol: {0}", myRI1.ISOCurrencySymbol );
}
}
/*
This code produces the following output.
Name: US
DisplayName: United States
EnglishName: United States
IsMetric: False
ThreeLetterISORegionName: USA
ThreeLetterWindowsRegionName: USA
TwoLetterISORegionName: US
CurrencySymbol: $
ISOCurrencySymbol: USD
*/
Imports System.Globalization
Public Class SamplesRegionInfo
Public Shared Sub Main()
' Displays the property values of the RegionInfo for "US".
Dim myRI1 As New RegionInfo("US")
Console.WriteLine(" Name: {0}", myRI1.Name)
Console.WriteLine(" DisplayName: {0}", myRI1.DisplayName)
Console.WriteLine(" EnglishName: {0}", myRI1.EnglishName)
Console.WriteLine(" IsMetric: {0}", myRI1.IsMetric)
Console.WriteLine(" ThreeLetterISORegionName: {0}", myRI1.ThreeLetterISORegionName)
Console.WriteLine(" ThreeLetterWindowsRegionName: {0}", myRI1.ThreeLetterWindowsRegionName)
Console.WriteLine(" TwoLetterISORegionName: {0}", myRI1.TwoLetterISORegionName)
Console.WriteLine(" CurrencySymbol: {0}", myRI1.CurrencySymbol)
Console.WriteLine(" ISOCurrencySymbol: {0}", myRI1.ISOCurrencySymbol)
End Sub
End Class
'This code produces the following output.
'
' Name: US
' DisplayName: United States
' EnglishName: United States
' IsMetric: False
' ThreeLetterISORegionName: USA
' ThreeLetterWindowsRegionName: USA
' TwoLetterISORegionName: US
' CurrencySymbol: $
' ISOCurrencySymbol: USD
Aplica-se a
Colabore connosco no GitHub
A origem deste conteúdo pode ser encontrada no GitHub, onde também pode criar e rever problemas e pedidos Pull. Para mais informações, consulte o nosso guia do contribuidor.