Exemple #1
0
        public WDClientServices(ILogger <WDClientServices> logger,
                                ILocalScriptRunner localScriptRunner,
                                IRemoteScriptRunner remoteScriptRunner,
                                string localIpAddress,
                                string scriptNameManageScreenResolutions,
                                string scriptArgsManageScreenResolutions,
                                string scriptNameStartStreamingSink,
                                string scriptArgsStartStreamingSink,
                                string scriptNameStartStreamingSource,
                                string scriptArgsStartStreamingSource,
                                string scriptNamePreventDisplayBlanking,
                                string scriptArgsPreventDisplayBlanking)
        {
            _logger             = logger;
            _localScriptRunner  = localScriptRunner;
            _remoteScriptRunner = remoteScriptRunner;
            _localIpAddress     = localIpAddress;
            _scriptNameManageScreenResolutions = scriptNameManageScreenResolutions;
            _scriptArgsManageScreenResolutions = scriptArgsManageScreenResolutions;
            _scriptNameStartStreamingSink      = scriptNameStartStreamingSink;
            _scriptArgsStartStreamingSink      = scriptArgsStartStreamingSink;
            _scriptNameStartStreamingSource    = scriptNameStartStreamingSource;
            _scriptArgsStartStreamingSource    = scriptArgsStartStreamingSource;
            _scriptNamePreventDisplayBlanking  = scriptNamePreventDisplayBlanking;
            _scriptArgsPreventDisplayBlanking  = scriptArgsPreventDisplayBlanking;

            _inialLocalScreenResolution =
                ((IWDClientServices)this).GetCurrentLocalScreenResolution();
        }
Exemple #2
0
        public void Setup()
        {
            // Start Scripting-REST-API-Server
            var serverExecutable = new FileInfo(SERVER_EXECUTABLE_PATH_LINUX);

            Assert.True(serverExecutable.Exists);
            _serverProcess = new Process();
            _serverProcess.StartInfo.FileName         = serverExecutable.FullName;
            _serverProcess.StartInfo.Arguments        = SERVER_CMD_LINE_ARGS;
            _serverProcess.StartInfo.WorkingDirectory = serverExecutable.Directory.FullName;

            _serverProcess.Start();

            //wait until server starts
            Console.Write("Waiting 5 Seconds for REST-API-Server to start");
            for (int i = 0; i < 5; i++)
            {
                Thread.Sleep(1000);
                Console.Write(".");
            }
            Console.WriteLine();

            // Logging:
            var loggerFactory = LoggerFactory.Create(builder =>
            {
                builder.AddFilter("Default", LogLevel.Debug).AddConsole();
            });
            var logger = loggerFactory.CreateLogger <RemoteScriptRunner>();

            _scriptRunner = new RemoteScriptRunner(logger);
            _scriptRunner.SetIpAddressAndPort(SERVER_IP, Convert.ToUInt16(SERVER_PORT));
        }