This document is archived and information here might be outdated.  Recommended version.


IARUnitConverter.EsriUnitsAsString Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > PublisherControls > ESRI.ArcGIS.PublisherControls > Interfaces > IA > IARUnitConverter Interface > IARUnitConverter.EsriUnitsAsString Method
ArcGIS Developer Help

IARUnitConverter.EsriUnitsAsString Method

Converts the specified units to strings in upper or lower case.

[Visual Basic .NET]
Public Function EsriUnitsAsString ( _
    ByVal units As esriARUnits, _
    ByVal caseAppearance As esriARCaseAppearance, _
    ByVal bPlural As Boolean _
) As String
[C#]
public string EsriUnitsAsString (
    esriARUnits units,
    esriARCaseAppearance caseAppearance,
    bool bPlural
);

Product Availability

Available with ArcGIS Desktop. Requires Publisher Extension.

Description

Converts the specified units to a string. Specify the case (eg. lower or upper case) of the string and whether the string specifies a single unit or many unit(s). For example, the method could convert the page units into an upper cased string.

Errors Returned

2122 800A084A: The specified enum value is invalid 

[C#]
IARUnitConverter unitConverter = axArcReaderControl1.ARUnitConverter;
string s;
//Returns 'CENTIMETER'
s = unitConverter.EsriUnitsAsString(esriARUnits.esriARUnitsCentimeters, esriARCaseAppearance.esriARCaseAppearanceUpper, false);
//Returns 'centimeters'
s = unitConverter.EsriUnitsAsString(esriARUnits.esriARUnitsCentimeters, esriARCaseAppearance.esriARCaseAppearanceLower, true);
//Returns 'Decimal Degree'
s = unitConverter.EsriUnitsAsString(esriARUnits.esriARUnitsDecimalDegrees, esriARCaseAppearance.esriARCaseAppearanceUnchanged, false);
//Returns 'Decimal Degrees'
s = unitConverter.EsriUnitsAsString(esriARUnits.esriARUnitsDecimalDegrees, esriARCaseAppearance.esriARCaseAppearanceUnchanged, true);
[Visual Basic .NET]
Dim pUnitConverter As IARUnitConverter
pUnitConverter = AxArcReaderControl1.ARUnitConverter
Dim s As String
'Returns 'CENTIMETER'
s = pUnitConverter.EsriUnitsAsString(esriARUnits.esriARUnitsCentimeters, esriARCaseAppearance.esriARCaseAppearanceUpper, False)
'Returns 'centimeters'
s = pUnitConverter.EsriUnitsAsString(esriARUnits.esriARUnitsCentimeters, esriARCaseAppearance.esriARCaseAppearanceLower, True)
'Returns 'Decimal Degree'
s = pUnitConverter.EsriUnitsAsString(esriARUnits.esriARUnitsDecimalDegrees, esriARCaseAppearance.esriARCaseAppearanceUnchanged, False)
'Returns 'Decimal Degrees'
s = pUnitConverter.EsriUnitsAsString(esriARUnits.esriARUnitsDecimalDegrees, esriARCaseAppearance.esriARCaseAppearanceUnchanged, True)   

See Also

IARUnitConverter Interface