コード例 #1
0
 /// <summary>
 /// Adds a switch style option to the configuration.
 /// </summary>
 /// <param name="template">Template that identifies the switch.</param>
 /// <param name="configureAction">Configuration action.</param>
 /// <returns>Configuration.</returns>
 public CommandConfiguration <TOptions> Switch(string template,
                                               Action <ArgumentConfiguration <TOptions, bool> > configureAction)
 {
     return(ConfigureArgument <bool>(template, builder => ArgumentConfiguration <TOptions, bool>
                                     .Configure(builder, configureAction)
                                     .Switch(Template.ForOptionOrSwitch(template))));
 }
コード例 #2
0
 internal ValidationConfiguration(ArgumentConfiguration<TOptions, TValue> configuration,
     IComponentSink<IValidator<TValue>> componentSink)
 {
     _configuration = configuration;
     _componentSink = componentSink;
 }
コード例 #3
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="configuration">Configuration.</param>
 /// <param name="mapperSink">Mapper sink component.</param>
 internal MappingConfiguration(ArgumentConfiguration <TOptions, TValue> configuration,
                               IComponentSink <IMapper <TOptions, TValue> > mapperSink)
 {
     Configuration = configuration;
     _mapperSink   = mapperSink;
 }
コード例 #4
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="configuration">Argument configuration.</param>
 /// <param name="converterSink">Component sink.</param>
 internal ConversionConfiguration(ArgumentConfiguration <TOptions, TValue> configuration,
                                  IComponentSink <IValueConverter <TValue> > converterSink)
 {
     _configuration = configuration;
     _converterSink = converterSink;
 }