Provides a type converter to convert Hotkey objects to and from other representations.
Inheritance: System.Windows.Forms.KeysConverter
Exemple #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));
        }
        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Back)
            {
                Reset();
                return;
            }

            var converter = new HotkeyConverter();
            Hotkey = (Hotkey) converter.ConvertFrom(e.KeyData);
            RenderText();
        }
Exemple #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();
        }