SymbolExplorer.SectionToStringConverter.ConvertBack C# (CSharp) Метод

ConvertBack() публичный Метод

public ConvertBack ( object value, Type targetType, object parameter, System culture ) : object
value object
targetType System.Type
parameter object
culture System
Результат object
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null) { return null; }
            if (value.GetType() != typeof(string)) { throw new InvalidOperationException(); }
            if (targetType != typeof(short)) { throw new InvalidOperationException(); }

            string val = (string)value;

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

            return short.Parse(val);
        }
SectionToStringConverter