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(); }
protected override void OnKeyDown(KeyEventArgs e) { if (e.KeyCode == Keys.Back) { Reset(); return; } var converter = new HotkeyConverter(); Hotkey = (Hotkey)converter.ConvertFrom(e.KeyData); RenderText(); }