public ToolsForTransactionWindow(IUnityContainer container, IToolRepository db) { InitializeComponent(); Container = container; _db = db; this.PreviewKeyDown += new KeyEventHandler(HandleEsc); }
/// <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); }
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 }
/// <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); }
public ToolsController(IToolRepository repository, ILoggerManager logger, IMapper mapper, IUnitOfWork unitOfWork) { _repository = repository; _logger = logger; _mapper = mapper; _unitOfWork = unitOfWork; }
public ToolResolutionStrategyFixture() { Environment = FakeEnvironment.CreateUnixEnvironment(); FileSystem = new FakeFileSystem(Environment); Globber = new Globber(FileSystem, Environment); Configuration = new FakeConfiguration(); Repository = new ToolRepository(Environment); }
public ToolsWindow(IUnityContainer container, IToolRepository db) { Container = container; _db = db; InitializeComponent(); this.PreviewKeyDown += new KeyEventHandler(HandleEsc); _toolDataContext = _db.GetAll(); }
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); }
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)); }
/// <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; }
public ToolsController(IToolRepository repository) : base(repository) { }
public ToolController(IToolRepository toolRepo, IAppRepository appRepo) { _appRepo = appRepo; _toolRepo = toolRepo; }
public OperationService(IOperationRepository operationRepository, IToolRepository toolRepository) { _operationRepository = operationRepository ?? throw new ArgumentNullException(nameof(operationRepository)); _toolRepository = toolRepository ?? throw new ArgumentNullException(nameof(toolRepository)); }
public Manager(IToolRepository repository);
public ToolServices(IToolRepository toolRepo) { _toolRepository = toolRepo; }
public ToolService(IToolRepository toolRepository) { _toolRepository = toolRepository ?? throw new ArgumentNullException(nameof(toolRepository)); }
public ToolsController(IToolRepository toolRepository, IMapper mapper) { _toolRepository = toolRepository; _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
private static FilePath LookInRegistrations(IToolRepository repository, string tool) { return(repository.Resolve(tool).LastOrDefault()); }
public ValidateToolExistsAttribute(IToolRepository repository, ILoggerManager logger) { _repository = repository; _logger = logger; }
public ToolsController(IToolRepository toolRepo) { _toolRepo = toolRepo; }