SymbolExplorer.SectionToStringConverter.Convert C# (CSharp) Method

Convert() public method

public Convert ( object value, Type targetType, object parameter, System culture ) : object
value object
targetType System.Type
parameter object
culture System
return object
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null) { return null; }
            if (value.GetType() != typeof(short)) { throw new InvalidOperationException(); }
            if (targetType != typeof(string)) { throw new InvalidOperationException(); }

            short val = (short)value;

            switch (val)
            {
            case Constants.IMAGE_SYM_UNDEFINED: return "Common";
            case Constants.IMAGE_SYM_ABSOLUTE: return "Absolute";
            case Constants.IMAGE_SYM_DEBUG: return "Debug";
            }

            return val.ToString();
        }
SectionToStringConverter