ConvertFrom() public method

public ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object
context ITypeDescriptorContext
culture System.Globalization.CultureInfo
value object
return object
Exemplo n.º 1
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            var converter = new HotkeyConverter();

            var keys = (value == null) ? Keys.None : (Keys)converter.ConvertTo(value, typeof(Keys));

            value = base.EditValue(context, provider, keys);

            return(converter.ConvertFrom(value));
        }
Exemplo n.º 2
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Back)
            {
                Reset();
                return;
            }

            var converter = new HotkeyConverter();
            Hotkey = (Hotkey) converter.ConvertFrom(e.KeyData);
            RenderText();
        }
Exemplo n.º 3
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Back)
            {
                Reset();
                return;
            }

            var converter = new HotkeyConverter();

            Hotkey = (Hotkey)converter.ConvertFrom(e.KeyData);
            RenderText();
        }