ArcGISPortalViewer.Controls.SettingToStringConverter.Convert C# (CSharp) Method

Convert() public method

public Convert ( object value, Type targetType, object parameter, string language ) : object
value object
targetType System.Type
parameter object
language string
return object
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value is LinearUnitType)
            {
                var unit = (LinearUnitType)value;
                switch (unit)
                {
                    case LinearUnitType.Metric:
                        return "Meters, Kilometers";
                    case LinearUnitType.ImperialUS:
                        return "Feet, Miles";
                }
            }
            else if (value is CoordinateFormat)
            {
                var format = (CoordinateFormat)value;
                switch (format)
                {
                    case CoordinateFormat.DecimalDegrees:
                        return "Decimal Degrees";
                    case CoordinateFormat.DegreesDecimalMinutes:
                        return "Degrees, Decimal Minutes";
                    case CoordinateFormat.Dms:
                        return "Degrees, Minutes, Seconds";
                    case CoordinateFormat.Mgrs:
                        return "Military Grid";
                }
            }
            return null;
        }
SettingToStringConverter