コード例 #1
0
        protected override void OnStart(string[] args)
        {
            EventLog.WriteEntry("Starting the service.");

            var config = (SauceConnectSectionConfiguration)ConfigurationManager.GetSection("sauceLabsConfiguration");
            var sauceLabsRestClient = new SauceLabsRestClient(config.Username, config.AccessKey);
            var logger = new EventLogLogger(EventLog);

            _sauceConnectWrapper = new SauceConnectWrapper(logger, sauceLabsRestClient, config);
            _sauceConnectWrapper.Start();
        }
コード例 #2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            if (Environment.UserInteractive)
            {
                var logger = new ConsoleLogger();
                logger.Log("Starting the service.");

                var config = (SauceConnectSectionConfiguration)ConfigurationManager.GetSection("sauceLabsConfiguration");
                var sauceLabsRestClient = new SauceLabsRestClient(config.Username, config.AccessKey);

                var sauceConnectWrapper = new SauceConnectWrapper(logger, sauceLabsRestClient, config);
                sauceConnectWrapper.Start();

                logger.Log("Press any key to quit.");
                Console.ReadLine();
            }
            else
            {
                RunService();
            }
        }