/// <summary> /// Is the given command a valid command for this switch (i.e. is this switch used by this command) /// </summary> /// <param name="argument"></param> /// <param name="command"></param> /// <returns></returns> private bool IsValidForCommand(CommandLineArgument argument, string command) { if (argument.IsValidForCommand(command)) return true; // check the command attributes instead if they contain this switch name EnsureCommandSwitches(); return Array.Exists(commandSwitches[command], delegate(string s) { return string.CompareOrdinal(s, argument.Name) == 0; }); }
/// <summary> /// Is the argument valid of for this command? /// </summary> /// <param name="argument"></param> /// <param name="command"></param> /// <returns></returns> private bool IsValidArgumentForCommand(CommandLineArgument argument, string command) { if (argument.IsValidForCommand(command)) return true; LazyGenerateCommandArguments(); return Array.Exists(commandArguments[command], delegate(string s) { return string.CompareOrdinal(s, argument.Name) == 0; }); }