public VagrantService(ICommandExecutor commandExecutor, IFileSystem fileSystem, IConfigurationSettings configuration) { _commandExecutor = commandExecutor; _fileSystem = fileSystem; _configuration = configuration; var vagrantFound = false; var customVagrantPath = _configuration.PathToVagrant; if (!string.IsNullOrWhiteSpace(customVagrantPath)) { if (!_fileSystem.file_exists(customVagrantPath)) { this.Log().Warn("Unable to find vagrant at the path specified. Using default instance."); } else { this.Log().Warn("Using custom vagrant path at '{0}'.".format_with(customVagrantPath)); vagrantFound = true; _vagrantExecutable = customVagrantPath; } } if (!vagrantFound) { _vagrantExecutable = @"C:\HashiCorp\Vagrant\bin\vagrant.exe"; if (!_fileSystem.file_exists(_vagrantExecutable)) { _vagrantExecutable = _fileSystem.get_executable_path("vagrant.exe"); } } //use_vagrant_directly(); }
public SliderCommandService(ISliderService sliderService, IUnitOfWork unitOfWork, ICommandExecutor executor) { _sliderService = sliderService; _unitOfWork = unitOfWork; _executor = executor; _userSession = new UserSession(); }
/// <summary> /// Initializes a new instance of the <see cref="RemoteWebDriver"/> class /// </summary> /// <param name="commandExecutor">An <see cref="ICommandExecutor"/> object which executes commands for the driver.</param> /// <param name="desiredCapabilities">An <see cref="ICapabilities"/> object containing the desired capabilities of the browser.</param> public RemoteWebDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) { this.executor = commandExecutor; this.StartClient(); this.StartSession(desiredCapabilities); this.mouse = new RemoteMouse(this); this.keyboard = new RemoteKeyboard(this); if (this.capabilities.HasCapability(CapabilityType.SupportsApplicationCache)) { object appCacheCapability = this.capabilities.GetCapability(CapabilityType.SupportsApplicationCache); if (appCacheCapability is bool && (bool)appCacheCapability) { this.appCache = new RemoteApplicationCache(this); } } if (this.capabilities.HasCapability(CapabilityType.SupportsLocationContext)) { object locationContextCapability = this.capabilities.GetCapability(CapabilityType.SupportsLocationContext); if (locationContextCapability is bool && (bool)locationContextCapability) { this.locationContext = new RemoteLocationContext(this); } } if (this.capabilities.HasCapability(CapabilityType.SupportsWebStorage)) { object webContextCapability = this.capabilities.GetCapability(CapabilityType.SupportsWebStorage); if (webContextCapability is bool && (bool)webContextCapability) { this.storage = new RemoteWebStorage(this); } } }
public CutoffModule(IEpisodeService episodeService, IEpisodeCutoffService episodeCutoffService, ISeriesRepository seriesRepository, ICommandExecutor commandExecutor) : base(episodeService, commandExecutor, "wanted/cutoff") { _episodeCutoffService = episodeCutoffService; _seriesRepository = seriesRepository; GetResourcePaged = GetCutoffUnmetEpisodes; }
public void Setup() { _commandExecutor = MockRepository.GenerateMock<ICommandExecutor>(); _messageManager = MockRepository.GenerateMock<IMessageManager>(); _referrerProvider = MockRepository.GenerateMock<IReferrerProvider>(); _controller = new DummyExecuteController( _commandExecutor, _messageManager, _referrerProvider ); }
public PersonCommandService(IPersonService personService, IUnitOfWork unitOfWork, ICommandExecutor executor) { _personService = personService; _unitOfWork = unitOfWork; _executor = executor; _userSession = new UserSession(); }
public ExchangeRateCommandService(IExchangeRateService exchangeRateService, IUnitOfWork unitOfWork, ICommandExecutor executor) { _exchangeRateService = exchangeRateService; _unitOfWork = unitOfWork; _executor = executor; _userSession = new UserSession(); }
public AdbTools(TextBlock context) { this.Context = context; _cmd = new Command(); _cmds = new List<Command>(); _executor = new CommandExecutor(); }
public OrderingHistoryCommandService(IOrderingHistoryService orderingHistoryService, IUnitOfWork unitOfWork, ICommandExecutor executor) { _orderingHistoryService = orderingHistoryService; _unitOfWork = unitOfWork; _executor = executor; _userSession = new UserSession(); }
public TypeMemberCommandService(ITypeMemberService typeMemberService, IUnitOfWork unitOfWork, ICommandExecutor executor) { _typeMemberService = typeMemberService; _unitOfWork = unitOfWork; _executor = executor; _userSession = new UserSession(); }
public CommandExecutorContext(ICommandExecutor executor, CommandLine commandLine, CommandTreeNode commandNode, object parameter) : base(executor, null, commandNode, parameter) { if(commandLine == null) throw new ArgumentNullException("commandLine"); _commandLine = commandLine; }
public WindowsFeatureService(ICommandExecutor commandExecutor, INugetService nugetService, IFileSystem fileSystem) { _commandExecutor = commandExecutor; _nugetService = nugetService; _fileSystem = fileSystem; set_cmd_args_dictionaries(); }
public RedownloadFailedDownloadService(IConfigService configService, IEpisodeService episodeService, ICommandExecutor commandExecutor, Logger logger) { _configService = configService; _episodeService = episodeService; _commandExecutor = commandExecutor; _logger = logger; }
public PersonReportService(ICommandExecutor executor, IRepository<Domain.Entity.User> userRepository, IPersonService personService) { _executor = executor; _personService = personService; _userRepository = userRepository; _userSession = new UserSession(); }
public MissingModule(IEpisodeService episodeService, ISeriesRepository seriesRepository, ICommandExecutor commandExecutor) : base(episodeService, commandExecutor, "wanted/missing") { _episodeService = episodeService; _seriesRepository = seriesRepository; GetResourcePaged = GetMissingEpisodes; }
public CommandServicePresenter(IView view, IService service, ICommandExecutor executor) { _view = view; _service = service; _executor = executor; }
public WebSiteLinkCommandService(IWebSiteLinkService webSiteLinkService, IUnitOfWork unitOfWork, ICommandExecutor executor) { _webSiteLinkService = webSiteLinkService; _unitOfWork = unitOfWork; _executor = executor; _userSession = new UserSession(); }
public ContentMenuCommandService(IContentMenuService contentMenuService, IUnitOfWork unitOfWork, ICommandExecutor executor) { _contentMenuService = contentMenuService; _unitOfWork = unitOfWork; _executor = executor; _userSession = new UserSession(); }
public UpdateSummonersWorker(ICommandExecutor commandExecutor, IUpdateSummonerQueue updateSummonerQueue) { Guard.NotNull(commandExecutor, nameof(commandExecutor)); Guard.NotNull(updateSummonerQueue, nameof(updateSummonerQueue)); this._commandExecutor = commandExecutor; this._updateSummonerQueue = updateSummonerQueue; }
/*============================================================================*/ /* Constructor */ /*============================================================================*/ public EventCommandTrigger (IInjector injector, IEventDispatcher dispatcher, Enum type, Type eventClass = null, IEnumerable<CommandMappingList.Processor> processors = null, ILogger logger = null) { _dispatcher = dispatcher; _type = type; _eventClass = eventClass; _mappings = new CommandMappingList(this, processors, logger); _executor = new CommandExecutor(injector, _mappings.RemoveMapping); }
public AutomaticUninstallerService(IChocolateyPackageInformationService packageInfoService, IFileSystem fileSystem, IRegistryService registryService, ICommandExecutor commandExecutor) { _packageInfoService = packageInfoService; _fileSystem = fileSystem; _registryService = registryService; _commandExecutor = commandExecutor; WaitForCleanup = true; }
public void ExecuteCommands(ObjectTypeId objectTypeId, ICommandExecutor commandExecutor, CompositeCommandExecutionContext compositeContext) { foreach (var command in commands) { var context = compositeContext.GetFor(command.TargetObjectId); commandExecutor.Execute(command, context); } }
/// <summary> /// Initializes a new instance of the RemoteWebDriver class /// </summary> /// <param name="commandExecutor">An <see cref="ICommandExecutor"/> object which executes commands for the driver.</param> /// <param name="desiredCapabilities">An <see cref="ICapabilities"/> object containing the desired capabilities of the browser.</param> public RemoteWebDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) { this.executor = commandExecutor; this.StartClient(); this.StartSession(desiredCapabilities); this.mouse = new RemoteMouse(this); this.keyboard = new RemoteKeyboard(this); }
public CygwinService(ICommandExecutor commandExecutor, INugetService nugetService, IFileSystem fileSystem, IRegistryService registryService) { _commandExecutor = commandExecutor; _nugetService = nugetService; _fileSystem = fileSystem; _registryService = registryService; set_cmd_args_dictionaries(); }
public OrderingCommandService(IOrderingService orderingService, IKeyGenerationReportService keyGenerationReportService, IUnitOfWork unitOfWork, ICommandExecutor executor) { _orderingService = orderingService; _unitOfWork = unitOfWork; _executor = executor; _keyGenerationReportService = keyGenerationReportService; _userSession = new UserSession(); }
public EpisodeModule(ICommandExecutor commandExecutor, IEpisodeService episodeService) : base(episodeService, commandExecutor) { _episodeService = episodeService; GetResourceAll = GetEpisodes; UpdateResource = SetMonitored; }
public CommandContext(ICommandExecutor executor, CommandLine commandLine, CommandTreeNode commandNode, object parameter, IDictionary<string, object> items = null) : base(executor, commandNode, parameter, items) { _commandLine = commandLine; if(commandLine == null) _options = new CommandOptionCollection(this.Command); else _options = new CommandOptionCollection(this.Command, (System.Collections.IDictionary)commandLine.Options); }
public PhonebookManager( string defaultCountryCode, IOutputWritter resultReporter, ICommandExecutor commandExecutor) { this.defaultCountryCode = defaultCountryCode; this.resultReporter = resultReporter; this.commandExecutor = commandExecutor; }
public GameEngine( ICommandParser commandParser, ICommandExecutor commandExecutor, IConsoleOperator consoleOperator) { this.CommandParser = commandParser; this.ConsoleOperator = consoleOperator; this.CommandExecutor = commandExecutor; }
public IncrementalCachingSnapshot(ISnapshot parentSnapshot, ICommandExecutor commandExecutor, IChangeSet changeSet) { this.parentSnapshot = parentSnapshot; this.commandExecutor = commandExecutor; foreach (var command in changeSet.Commands) { Load(command); } }
public SessionService(IMapper mapper, IQueryExecutor queryExecutor, ICommandExecutor commandExecutor) { _mapper = mapper; _queryExecutor = queryExecutor; _commandExecutor = commandExecutor; }
public SignalEventReceivedBuilderImpl(ICommandExecutor commandExecutor, string signalName) { this.CommandExecutor = commandExecutor; this.SignalName = signalName; }
public IngredientService(IQueryExecutor queryExecutor, ICommandExecutor commandExecutor, IIdGenerator idGenerator) { m_queryExecutor = queryExecutor; m_commandExecutor = commandExecutor; m_idGenerator = idGenerator; }
public LinuxCpuStatusProvider(ICommandExecutor commandExecutor, ICommandOutputParser outputParser) { _commandExecutor = commandExecutor; _outputParser = outputParser; }
public DeleteInvoiceHandler(ICommandExecutor commandExecutor, IQueryExecutor queryExecutor, IMapper mapper) { this.commandExecutor = commandExecutor; this.queryExecutor = queryExecutor; this.mapper = mapper; }
public new void RegisterExecutor <TCommand>(ICommandExecutor <TCommand> executor) where TCommand : ICommand { base.RegisterExecutor(executor); }
public ICommand PerformGroupRequest(IRequest request, ICommandExecutor executor) { return(PerformGroupRequest(request, null, executor)); }
public static TemporaryDirectory DownloadAndApply([NotNull] this DownloadRetrievalMethod retrievalMethod, [NotNull] ITaskHandler handler, [CanBeNull] ICommandExecutor executor = null) { #region Sanity checks if (retrievalMethod == null) { throw new ArgumentNullException("retrievalMethod"); } if (handler == null) { throw new ArgumentNullException("handler"); } #endregion using (var downloadedFile = retrievalMethod.Download(handler, executor)) { var extractionDir = new TemporaryDirectory("0publish"); try { new PerTypeDispatcher <DownloadRetrievalMethod>(ignoreMissing: false) { // ReSharper disable AccessToDisposedClosure (Archive archive) => archive.Apply(downloadedFile, extractionDir, handler), (SingleFile file) => file.Apply(downloadedFile, extractionDir, handler) // ReSharper restore AccessToDisposedClosure }.Dispatch(retrievalMethod); } #region Error handling catch { extractionDir.Dispose(); throw; } #endregion return(extractionDir); } }
public static TemporaryDirectory DownloadAndApply([NotNull] this RetrievalMethod retrievalMethod, [NotNull] ITaskHandler handler, [CanBeNull] ICommandExecutor executor = null) { #region Sanity checks if (retrievalMethod == null) { throw new ArgumentNullException("retrievalMethod"); } if (handler == null) { throw new ArgumentNullException("handler"); } #endregion var download = retrievalMethod as DownloadRetrievalMethod; if (download != null) { return(download.DownloadAndApply(handler, executor)); } var recipe = retrievalMethod as Recipe; if (recipe != null) { return(recipe.DownloadAndApply(handler, executor)); } throw new NotSupportedException(Resources.UnknownRetrievalMethodType); }
public static TemporaryDirectory LocalApply([NotNull] this DownloadRetrievalMethod retrievalMethod, string localPath, [NotNull] ITaskHandler handler, [CanBeNull] ICommandExecutor executor = null) { #region Sanity checks if (retrievalMethod == null) { throw new ArgumentNullException("retrievalMethod"); } if (string.IsNullOrEmpty(localPath)) { throw new ArgumentNullException("localPath"); } if (handler == null) { throw new ArgumentNullException("handler"); } #endregion if (executor == null) { executor = new SimpleCommandExecutor(); } // Set local file size long newSize = new FileInfo(localPath).Length; if (retrievalMethod.Size != newSize) { executor.Execute(new SetValueCommand <long>(() => retrievalMethod.Size, value => retrievalMethod.Size = value, newSize)); } var extractionDir = new TemporaryDirectory("0publish"); try { new PerTypeDispatcher <DownloadRetrievalMethod>(ignoreMissing: true) { // ReSharper disable AccessToDisposedClosure (Archive archive) => { // Guess MIME types now because the file ending is not known later if (string.IsNullOrEmpty(archive.MimeType)) { string mimeType = Archive.GuessMimeType(localPath); executor.Execute(new SetValueCommand <string>(() => archive.MimeType, value => archive.MimeType = value, mimeType)); } archive.Apply(localPath, extractionDir, handler); }, (SingleFile file) => { // Guess file name based on local path if (string.IsNullOrEmpty(file.Destination)) { string destination = Path.GetFileName(localPath); executor.Execute(new SetValueCommand <string>(() => file.Destination, value => file.Destination = value, destination)); } file.Apply(localPath, extractionDir, handler); } // ReSharper restore AccessToDisposedClosure }.Dispatch(retrievalMethod); } #region Error handling catch { extractionDir.Dispose(); throw; } #endregion return(extractionDir); }
public static TemporaryFile Download([NotNull] this DownloadRetrievalMethod retrievalMethod, [NotNull] ITaskHandler handler, [CanBeNull] ICommandExecutor executor = null) { #region Sanity checks if (retrievalMethod == null) { throw new ArgumentNullException("retrievalMethod"); } if (handler == null) { throw new ArgumentNullException("handler"); } #endregion if (executor == null) { executor = new SimpleCommandExecutor(); } if (retrievalMethod.Href == null) { throw new ArgumentException(Resources.HrefMissing, "retrievalMethod"); } new PerTypeDispatcher <DownloadRetrievalMethod>(ignoreMissing: false) { // ReSharper disable AccessToDisposedClosure (Archive archive) => { // Guess MIME types now because the file ending is not known later if (string.IsNullOrEmpty(archive.MimeType)) { string mimeType = Archive.GuessMimeType(archive.Href.OriginalString); executor.Execute(new SetValueCommand <string>(() => archive.MimeType, value => archive.MimeType = value, mimeType)); } }, (SingleFile file) => { // Guess file name based on URL if (string.IsNullOrEmpty(file.Destination)) { string destination = file.Href.OriginalString.GetRightPartAtLastOccurrence('/').StripCharacters(Path.GetInvalidFileNameChars()); executor.Execute(new SetValueCommand <string>(() => file.Destination, value => file.Destination = value, destination)); } } // ReSharper restore AccessToDisposedClosure }.Dispatch(retrievalMethod); // Download the file var href = ModelUtils.GetAbsoluteHref(retrievalMethod.Href, string.IsNullOrEmpty(executor.Path) ? null : new FeedUri(executor.Path)); var downloadedFile = new TemporaryFile("0publish"); handler.RunTask(new DownloadFile(href, downloadedFile)); // Defer task to handler // Set downloaded file size long newSize = new FileInfo(downloadedFile).Length; if (retrievalMethod.Size != newSize) { executor.Execute(new SetValueCommand <long>(() => retrievalMethod.Size, value => retrievalMethod.Size = value, newSize)); } return(downloadedFile); }
public Engine(IKingdomRepository repo) { this.repository = repo; this.executor = new CommandExecutor(); }
protected internal virtual void clearDatabase() { ICommandExecutor commandExecutor = processEngineConfiguration.CommandExecutorTxRequired; commandExecutor.Execute(new CommandAnonymousInnerClass(this)); }
public AddBreedHandler(ICommandExecutor commandExecutor, IMapper mapper) { _commandExecutor = commandExecutor; _mapper = mapper; }
public PutBoardByIdHandler(IMapper mapper, ICommandExecutor commandExecutor, IQueryExecutor queryExecutor) { this.mapper = mapper; this.commandExecutor = commandExecutor; this.queryExecutor = queryExecutor; }
public MappedCommandExecutorProxy() { var factory = new AttributeBasedMappingFactory(); _executor = factory.CreateExecutorForCommand <T>(); }
public DeploymentQueryImpl(ICommandExecutor commandExecutor) : base(commandExecutor) { }
public ICommand PerformGroupRequest(IRequest request, IEditor commandProvider, ICommandExecutor executor) { var cmd = GetGroupCommand(request, commandProvider); if (cmd == null) { return(null); } commandProvider = commandProvider ?? _editors[0]; executor = executor ?? commandProvider.Site.CommandExecutor; using (commandProvider.Site.DirtManager.BeginDirty()) { executor.Execute(cmd); } return(cmd); }
public UpdatePlayerHandler(IMapper mapper, ICommandExecutor commandExecutor, IQueryExecutor queryExecutor) { this.mapper = mapper; this.commandExecutor = commandExecutor; this.queryExecutor = queryExecutor; }
public AppiumDriver(ICommandExecutor commandExecutor, ICapabilities appiumOptions) : base(commandExecutor, appiumOptions) { AppiumCommand.Merge(commandExecutor.CommandInfoRepository); ElementFactory = CreateElementFactory(); }
public KeyspaceConnection(ICommandExecutor <IFierceCommand> commandExecutor, string keyspaceName) { this.commandExecutor = commandExecutor; this.keyspaceName = keyspaceName; }
public TaskReportImpl(ICommandExecutor commandExecutor) { this.commandExecutor = commandExecutor; }
public CommandService(ICommandExecutor executor) { _executor = executor; }
public WiniumDriverCommandExecutor(WiniumDriverService driverService, TimeSpan commandTimeout) { this.service = driverService; this.internalExecutor = CommandExecutorFactory.GetHttpCommandExecutor(driverService.ServiceUrl, commandTimeout); }
/// <summary> /// 构造Uptime类 /// </summary> /// <param name="device"></param> /// <param name="executor"></param> public Uptime(IDevice device, ICommandExecutor executor) { this.device = device ?? throw new ArgumentNullException(nameof(device)); this.executor = executor ?? throw new ArgumentNullException(nameof(executor)); }
/// <summary> /// Initializes a new instance of the TizenDriver class /// </summary> /// <param name="commandExecutor">An <see cref="ICommandExecutor"/> object which executes commands for the driver.</param> /// <param name="AppiumOptions">An <see cref="ICapabilities"/> object containing the Appium options.</param> public TizenDriver(ICommandExecutor commandExecutor, AppiumOptions AppiumOptions) : base(commandExecutor, SetPlatformToCapabilities(AppiumOptions, Platform)) { }
public UserSuggestionService(IQueryExecutor queryExecutor, ICommandExecutor commandExecutor) { m_queryExecutor = queryExecutor; m_commandExecutor = commandExecutor; }
public DroidDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) : base(commandExecutor, desiredCapabilities) { TouchScreen = new RemoteTouchScreen(this); }
public static TemporaryDirectory DownloadAndApply([NotNull] this Recipe recipe, [NotNull] ITaskHandler handler, [CanBeNull] ICommandExecutor executor = null) { #region Sanity checks if (recipe == null) { throw new ArgumentNullException("recipe"); } if (handler == null) { throw new ArgumentNullException("handler"); } #endregion var downloadedFiles = new List <TemporaryFile>(); try { foreach (var step in recipe.Steps.OfType <DownloadRetrievalMethod>()) { downloadedFiles.Add(step.Download(handler, executor)); } // Apply the recipe return(recipe.Apply(downloadedFiles, handler)); } finally { // Clean up temporary archive files foreach (var downloadedFile in downloadedFiles) { downloadedFile.Dispose(); } } }