Skip to content

Instantly share code, notes, and snippets.

@AlexArchive
Created August 11, 2014 11:59
Show Gist options
  • Save AlexArchive/b98995c445eee866d52c to your computer and use it in GitHub Desktop.
Save AlexArchive/b98995c445eee866d52c to your computer and use it in GitHub Desktop.
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);
}
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
Keys keys = (value == null) ? Keys.None : (Keys)((Hotkey)value);
object obj = base.EditValue(context, provider, keys);
return (Hotkey)((Keys)obj);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment