private static ushort ReadKeybinding(string name) { string upperName = name.ToUpperInvariant(); return(Regex.Match(upperName, "^[A-Z0-9]$").Success ? upperName.ToCharArray()[0] : VK_KEYWORDS.ContainsKey(upperName) ? VK_KEYWORDS[upperName] : (ushort)0); }
static ushort readKeybinding(string name) { var upperName = name.ToUpperInvariant(); if (Regex.Match(upperName, "^[A-Z0-9]$").Success) { return((ushort)upperName.ToCharArray()[0]); } else if (VK_KEYWORDS.ContainsKey(upperName)) { return(VK_KEYWORDS [upperName]); } else { return(0); } }