Esempio 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);
 }
Esempio 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);
 }
Esempio 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);
 }
Esempio 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);
 }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
 }
Esempio 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);
 }
Esempio 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);
 }