Skip to content

Instantly share code, notes, and snippets.

@arman-hpp
Created May 21, 2020 03:16
Show Gist options
  • Save arman-hpp/ca95d36b79436a3443189d640bc20783 to your computer and use it in GitHub Desktop.
Save arman-hpp/ca95d36b79436a3443189d640bc20783 to your computer and use it in GitHub Desktop.
Enum.IsDefined
public KeyboardLayoutType LayoutType
{
get
{
return this.layoutType;
}
set
{
if (!Enum.IsDefined(typeof (KeyboardLayoutType), (object) value))
throw new ArgumentException("Invalid LayoutType. When setting the LayoutType property, it must be a valid member of the KeyboardLayoutType enumeration!");
this.MainLayoutPanel = this.GetLayoutPanelByLayoutType(value);
this.layoutType = value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment