private static Method Method(Build that, Type type, MethodInfo m) { var t = new TurnParametersToArgumentWithOptions(that.CultureInfo, that.TypeConverter); var @params = t.GetRecognizers(m).Select(p => new Param(p.Type, p.Argument.Prototype, p)); return new Method(m.Name, type.ControllerName(), that.HelpController()) { Parameters = new List<Param>(@params.ToArray()) }; }
/// <summary> /// </summary> public ControllerRecognizer(Type type, CultureInfo cultureInfo = null, Func<Type, string, CultureInfo, object> typeConverter = null, bool ignoreGlobalUnMatchedParameters = false, bool allowInferParameter = false) { Type = type; _culture = cultureInfo ?? CultureInfo.CurrentCulture; IgnoreGlobalUnMatchedParameters = ignoreGlobalUnMatchedParameters; _allowInferParameter = allowInferParameter; _turnParametersToArgumentWithOptions = new TurnParametersToArgumentWithOptions(_culture, typeConverter); }
public HelpForControllers(ICollection<Type> classAndMethodRecognizers, TypeContainer container, TurnParametersToArgumentWithOptions turnParametersToArgumentWithOptions, HelpXmlDocumentation helpXmlDocumentation = null) { _container = container; _turnParametersToArgumentWithOptions = turnParametersToArgumentWithOptions; _classAndMethodRecognizers = classAndMethodRecognizers; _helpXmlDocumentation = helpXmlDocumentation ?? new HelpXmlDocumentation(); HelpSubCommandForMoreInformation = "Se 'COMMANDNAME' help <command> <subcommand> for more information"; HelpCommandForMoreInformation = "Se 'COMMANDNAME' help <command> for more information"; TheCommandsAre = "The commands are:"; TheSubCommandsFor = "The sub commands for "; _andAcceptTheFollowingParameters = "And accept the following parameters"; }