Exemplo n.º 1
0
 public static void AddCommand <T, TCommand>(this ArgsMapper <T> mapper,
                                             Expression <Func <T, TCommand> > propertySelector)
     where T : class
     where TCommand : class
 {
     AddCommand(mapper, propertySelector, null, null);
 }
Exemplo n.º 2
0
 public static void AddOption <T, TOption>(this ArgsMapper <T> mapper,
                                           Expression <Func <T, TOption> > propertySelector, string longName,
                                           Action <ArgsOptionSettings <TOption> > optionSettings)
     where T : class
 {
     AddOption(mapper, propertySelector, null, longName, false, optionSettings);
 }
Exemplo n.º 3
0
 public static void AddPositionalOption <T, TOption>(this ArgsMapper <T> mapper,
                                                     Expression <Func <T, TOption> > propertySelector,
                                                     Action <ArgsOptionSettings <TOption> > optionSettings)
     where T : class
 {
     AddOption(mapper, propertySelector, null, null, true, optionSettings);
 }
Exemplo n.º 4
0
 public static void AddCommand <T, TCommand>(this ArgsMapper <T> mapper,
                                             Expression <Func <T, TCommand> > propertySelector,
                                             Action <ArgsCommandSettings <TCommand> > commandSettings)
     where T : class
     where TCommand : class
 {
     AddCommand(mapper, propertySelector, null, commandSettings);
 }
Exemplo n.º 5
0
        public static void AddCommand <T, TCommand>(this ArgsMapper <T> mapper,
                                                    Expression <Func <T, TCommand> > propertySelector, string name,
                                                    Action <ArgsCommandSettings <TCommand> > commandSettings)
            where T : class
            where TCommand : class
        {
            var command = CommandInitializer.Initialize(mapper,
                                                        propertySelector, name, commandSettings);

            mapper.CommandValidationService.Validate(mapper, command);

            mapper.Commands.Add(command);
        }
Exemplo n.º 6
0
        private static void AddOption <T, TOption>(this ArgsMapper <T> mapper,
                                                   Expression <Func <T, TOption> > propertySelector, char?shortName, string longName,
                                                   bool isPositional, Action <ArgsOptionSettings <TOption> > optionSettings)
            where T : class
        {
            int?position = null;

            if (isPositional)
            {
                position = mapper.Options.GetNextPositionalOptionPosition();
            }

            var option = OptionInitializer.Initialize(propertySelector, shortName,
                                                      longName, position, optionSettings, mapper.Settings.Culture);

            mapper.OptionValidationService.Validate(mapper, option);

            mapper.Options.Add(option);
        }
Exemplo n.º 7
0
 public static void AddOption <T, TOption>(this ArgsMapper <T> mapper,
                                           Expression <Func <T, TOption> > propertySelector)
     where T : class
 {
     AddOption(mapper, propertySelector, null, null, false, null);
 }
Exemplo n.º 8
0
 public static void AddPositionalOption <T, TOption>(this ArgsMapper <T> mapper,
                                                     Expression <Func <T, TOption> > propertySelector, string longName)
     where T : class
 {
     AddOption(mapper, propertySelector, null, longName, true, null);
 }
Exemplo n.º 9
0
 public static void AddOption <T, TOption>(this ArgsMapper <T> mapper,
                                           Expression <Func <T, TOption> > propertySelector, char shortName, string longName)
     where T : class
 {
     AddOption(mapper, propertySelector, shortName, longName, false, null);
 }