public ToolsForTransactionWindow(IUnityContainer container, IToolRepository db)
 {
     InitializeComponent();
     Container            = container;
     _db                  = db;
     this.PreviewKeyDown += new KeyEventHandler(HandleEsc);
 }
Пример #2
0
        /// <summary>
        /// Resolves the specified tool using the specified tool repository.
        /// </summary>
        /// <param name="repository">The tool repository.</param>
        /// <param name="tool">The tool.</param>
        /// <returns>
        /// The path to the tool; otherwise <c>null</c>.
        /// </returns>
        public FilePath Resolve(IToolRepository repository, string tool)
        {
            if (repository == null)
            {
                throw new ArgumentNullException("repository");
            }
            if (tool == null)
            {
                throw new ArgumentNullException("tool");
            }
            if (string.IsNullOrWhiteSpace(tool))
            {
                throw new ArgumentException("Tool name cannot be empty.", "tool");
            }

            // Does this file already have registrations?
            var resolve = LookInRegistrations(repository, tool);

            if (resolve == null)
            {
                // Look in ./tools/
                resolve = LookInToolsDirectory(tool);
                if (resolve == null)
                {
                    // Look in the path environment variable.
                    resolve = LookInPath(tool);
                }
            }

            return(resolve);
        }
Пример #3
0
 public WeatherForecastController(IToolRepository toolRepository, ICheckoutRecordRepository checkoutRecordRepository, ILogger <WeatherForecastController> logger)
 {
     _logger                   = logger;
     _toolRepository           = toolRepository;
     _checkoutRecordRepository = checkoutRecordRepository;
     //don't forget to add this interface to dependency injection in startup
 }
Пример #4
0
        /// <inheritdoc/>
        public FilePath Resolve(IToolRepository repository, IEnumerable <string> toolExeNames)
        {
            if (repository == null)
            {
                throw new ArgumentNullException(nameof(repository));
            }
            if (toolExeNames == null)
            {
                throw new ArgumentNullException(nameof(toolExeNames));
            }

            var toolNames = toolExeNames.ToArray();

            if (toolNames.Any(string.IsNullOrWhiteSpace))
            {
                throw new ArgumentException("Tool names cannot be empty.", nameof(toolExeNames));
            }

            // Does this tool already have registrations?
            var resolve = toolNames.Select(tool => LookInRegistrations(repository, tool)).FirstOrDefault(tool => tool != null);

            if (resolve == null)
            {
                // Look in ./tools/
                resolve = toolNames.Select(LookInToolsDirectory).FirstOrDefault(tool => tool != null);
                if (resolve == null)
                {
                    // Look in the path environment variable.
                    resolve = toolNames.Select(LookInPath).FirstOrDefault(tool => tool != null);
                }
            }

            return(resolve);
        }
Пример #5
0
 public ToolsController(IToolRepository repository, ILoggerManager logger, IMapper mapper, IUnitOfWork unitOfWork)
 {
     _repository = repository;
     _logger     = logger;
     _mapper     = mapper;
     _unitOfWork = unitOfWork;
 }
Пример #6
0
 public ToolResolutionStrategyFixture()
 {
     Environment   = FakeEnvironment.CreateUnixEnvironment();
     FileSystem    = new FakeFileSystem(Environment);
     Globber       = new Globber(FileSystem, Environment);
     Configuration = new FakeConfiguration();
     Repository    = new ToolRepository(Environment);
 }
Пример #7
0
 public ToolsWindow(IUnityContainer container, IToolRepository db)
 {
     Container = container;
     _db       = db;
     InitializeComponent();
     this.PreviewKeyDown += new KeyEventHandler(HandleEsc);
     _toolDataContext     = _db.GetAll();
 }
Пример #8
0
 public ToolWindow(IUnityContainer container, IToolRepository db)
 {
     InitializeComponent();
     Container  = container;
     _db        = db;
     _producers = _db.GetProducers();
     _users     = _db.GetUsers();
     SelectProducer.ItemsSource  = _db.GetProducers();
     SelectDestroyed.ItemsSource = _users;
     SelectLost.ItemsSource      = _users;
     this.PreviewKeyDown        += new KeyEventHandler(HandleEsc);
 }
Пример #9
0
 public MachineTypeService(IMachineTypeRepository machineTypeRepository,
                           IOperationRepository operationRepository,
                           IMachineTypeOperationRepository machineTypeOperationRepository,
                           IToolRepository toolRepository
                           )
 {
     _machineTypeRepository =
         machineTypeRepository ?? throw new ArgumentNullException(nameof(machineTypeRepository));
     _operationRepository            = operationRepository ?? throw new ArgumentNullException(nameof(operationRepository));
     _machineTypeOperationRepository = machineTypeOperationRepository ??
                                       throw new ArgumentNullException(nameof(_machineTypeOperationRepository));
     _toolRepository = toolRepository ?? throw new ArgumentNullException(nameof(_toolRepository));
 }
Пример #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ToolLocator"/> class.
        /// </summary>
        /// <param name="environment">The environment.</param>
        /// <param name="repository">The tool repository.</param>
        /// <param name="strategy">The tool resolution strategy.</param>
        public ToolLocator(ICakeEnvironment environment, IToolRepository repository, IToolResolutionStrategy strategy)
        {
            if (environment == null)
            {
                throw new ArgumentNullException(nameof(environment));
            }
            if (repository == null)
            {
                throw new ArgumentNullException(nameof(repository));
            }
            if (strategy == null)
            {
                throw new ArgumentNullException(nameof(strategy));
            }

            _environment = environment;
            _repository  = repository;
            _strategy    = strategy;
        }
Пример #11
0
 public ToolsController(IToolRepository repository) : base(repository)
 {
 }
Пример #12
0
 public ToolController(IToolRepository toolRepo, IAppRepository appRepo)
 {
     _appRepo  = appRepo;
     _toolRepo = toolRepo;
 }
Пример #13
0
 public OperationService(IOperationRepository operationRepository, IToolRepository toolRepository)
 {
     _operationRepository = operationRepository ?? throw new ArgumentNullException(nameof(operationRepository));
     _toolRepository      = toolRepository ?? throw new ArgumentNullException(nameof(toolRepository));
 }
Пример #14
0
 public Manager(IToolRepository repository);
Пример #15
0
 public ToolServices(IToolRepository toolRepo)
 {
     _toolRepository = toolRepo;
 }
Пример #16
0
 public ToolService(IToolRepository toolRepository)
 {
     _toolRepository = toolRepository ?? throw new ArgumentNullException(nameof(toolRepository));
 }
Пример #17
0
 public ToolsController(IToolRepository toolRepository, IMapper mapper)
 {
     _toolRepository = toolRepository;
     _mapper         = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
Пример #18
0
 private static FilePath LookInRegistrations(IToolRepository repository, string tool)
 {
     return(repository.Resolve(tool).LastOrDefault());
 }
 public ValidateToolExistsAttribute(IToolRepository repository, ILoggerManager logger)
 {
     _repository = repository;
     _logger     = logger;
 }
Пример #20
0
 public ToolsController(IToolRepository toolRepo)
 {
     _toolRepo = toolRepo;
 }