AppHarbor.AliasMatcher.GetMatchedType C# (CSharp) Method

GetMatchedType() public method

public GetMatchedType ( string commandArgument ) : Type
commandArgument string
return System.Type
        public virtual Type GetMatchedType(string commandArgument)
        {
            try
            {
                return _candidateTypes.Single(
                    x => x.GetCustomAttributes(true).OfType<CommandHelpAttribute>().Single().Alias.ToLower() == commandArgument.ToLower());
            }
            catch (InvalidOperationException)
            {
                throw new ArgumentException("Command doesn't match any command alias");
            }
        }