This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > PublisherControls > ESRI.ArcGIS.PublisherControls > Interfaces > IA > IARUnitConverter Interface > IARUnitConverter.EsriUnitsAsString Method (ArcObjects .NET 10.4 SDK) |
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 );
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.
2122 800A084A: The specified enum value is invalid
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);
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)