Example #1
0
 public AttributeParser(AttributeConfiguration configuration, IParameterFormatter parameterFormatter, IValueConverter valueConverter, IHelpPresenter helpPresenter)
 {
     Configuration     = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _attributeHandler = new AttributeHandler(configuration, parameterFormatter,
                                              (option, value) =>
     {
         var parameterValueOption = configuration.GetParameterValueOption(option);
         return(valueConverter.ConvertFromString(option, parameterValueOption.ParameterInfo, AttributeHandler.GetValueType(parameterValueOption.Option, parameterValueOption.ParameterInfo.ParameterType), value));
     },
                                              (option) => configuration.GetParameterValueOption(option).ParameterInfo.ParameterType
                                              );
     _helpPresenter = helpPresenter ?? throw new ArgumentNullException(nameof(helpPresenter));
 }
 public DefaultErrorHandler(IErrorPresenter errorPresenter, IHelpPresenter helpPresenter)
 {
     _errorPresenter = errorPresenter;
     _helpPresenter  = helpPresenter;
 }