Exemplo n.º 1
0
 public LinkFromCommand(ICommandArgsParser <LinkFromCommandArgs> commandArgsParser, ILinkRegistryFile linkRegistryFile, IUserInterface ui, ICommandHelper commandHelper)
 {
     _commandArgsParser = commandArgsParser;
     _linkRegistryFile  = linkRegistryFile;
     _ui            = ui;
     _commandHelper = commandHelper;
 }
Exemplo n.º 2
0
 public RestoreCommand(
     ICommandArgsParser <RestoreCommandArgs> restoreCommandArgsParser,
     INetFxCsproj netFxCsproj,
     IUserInterface ui,
     IFilesystem filesystem,
     ICommandHelper commandHelper
     )
 {
     _restoreCommandArgsParser = restoreCommandArgsParser;
     _netFxCsproj   = netFxCsproj;
     _ui            = ui;
     _filesystem    = filesystem;
     _commandHelper = commandHelper;
 }
Exemplo n.º 3
0
 public LinkToCommand(
     ICommandArgsParser <LinkToCommandArgs> commandArgsParser,
     ILinkRegistryFile linkRegistryFile,
     IFilesystem filesystem,
     INetFxCsproj netFxCsproj,
     IUserInterface ui,
     ICommandHelper commandHelper
     )
 {
     _commandArgsParser = commandArgsParser;
     _linkRegistryFile  = linkRegistryFile;
     _filesystem        = filesystem;
     _netFxCsproj       = netFxCsproj;
     _ui            = ui;
     _commandHelper = commandHelper;
 }
Exemplo n.º 4
0
        public bool ValidateArgs <TCallee, TArgs>(ICommandArgsParser <TArgs> commandArgsParser, string[] args)
        {
            try
            {
                (var isValid, var reason) = commandArgsParser.IsValid(args);

                if (!isValid)
                {
                    LogAndExit(reason);
                    return(false);
                }
            }
            catch (UserRequestedExecutionStop)
            {
                return(false);
            }
            catch (Exception ex)
            {
                LogAndExit <TCallee>(ex);
                return(false);
            }

            return(true);
        }