Namespace:
ESRI.ArcGISExplorer.Geometry
Assembly:
ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.900 (2.0.0.900)
Syntax
C# |
---|
public string GetDisplayName( UnitNameOptions nameOptions ) |
Visual Basic (Declaration) |
---|
Public Function GetDisplayName ( _ nameOptions As UnitNameOptions _ ) As String |
Parameters
- nameOptions
- Type: ESRI.ArcGISExplorer.Geometry..::.UnitNameOptions
Indicates the form of name to return, for example a simplified form of the Unit name.
Return Value
A string containing the name of the Unit.
Remarks
You can use this method to return the name of a unit suitable for display in a user interface. Using UnitNameOptions.Simple returns the name of the basic unit of measurement, for example for MilesSurvey, the simple name would be 'Mile', and the detailed name would be 'Survey Mile'. Alternatively to find out the plural name of the unit, use GetPluralName(UnitNameOptions).
Note that for some units, the simple and detailed names are the same, for example Kilometers and Meters.
The value returned by this method may differ slightly from the value of the Name property, and is more suitable for display in a user interface.
Examples

// Create new Units with a specific unit of measurement. Unit feet = Unit.Linear.Feet; Unit degrees = Unit.Angular.Degrees; // Find out the conversion factors. double factorFeet = Unit.Convert(1, feet, Unit.Linear.Meters); string feetInfo = "1 " + feet.GetDisplayName(UnitNameOptions.Detailed) + " = " + factorFeet + " Meters"; double factorDegrees = Unit.Convert(1, degrees, Unit.Angular.Radians); string degreesInfo = "1 " + degrees.GetDisplayName(UnitNameOptions.Detailed) + " = " + factorDegrees + " Radians";

' Create new Units with a specific unit of measurement. Dim feet As Unit = Unit.Linear.Feet Dim degrees As Unit = Unit.Angular.Degrees ' Find out the conversion factors. Dim factorFeet As Double = Unit.Convert(1, feet, Unit.Linear.Meters) Dim feetInfo As String = "1 " & feet.GetDisplayName(UnitNameOptions.Detailed) & " = " & factorFeet & " Meters" Dim factorDegrees As Double = Unit.Convert(1, degrees, Unit.Angular.Radians) Dim degreesInfo As String = "1 " & degrees.GetDisplayName(UnitNameOptions.Detailed) & " = " & factorDegrees & " Radians"