Provides a type converter to convert Hotkey objects to and from other representations.
Inheritance: System.Windows.Forms.KeysConverter
Esempio 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));
        }
Esempio 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();
        }
Esempio 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();
        }