예제 #1
0
 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())
                };
 }
예제 #2
0
 /// <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);
 }
예제 #3
0
        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";
        }