Exemplo n.º 1
0
        public static void Main()
        {
            var httpChannel = new HttpChannel();
            var configuration = new BuildMonitorConfiguration
                                    {
                                        BuildServerStatusPageUri = new Uri("http://www.google.com"),
                                        SuccessfulBuildString = "I r successful",
                                        FailedBuildString = "I r failed"
                                    };

            _monitor = new BuildMonitor(configuration, httpChannel, OnSuccessfulBuild, OnFailedBuild, OnErrorDeterminingBuildStatus);
            _monitor.StartMonitoring();

            while(true)
            {
                Thread.Sleep(500);
            }
        }
        public BuildMonitor(BuildMonitorConfiguration configuration, IHttpChannel httpChannel,
                                                                     BuildSucceeded buildSuccessfulCallback, 
                                                                     BuildFailed buildFailedCallback, 
                                                                     FailedToEvaluateBuildStatus failedToEvaluateBuildStatus)
        {
            if(configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            if (httpChannel == null)
            {
                throw new ArgumentNullException("httpChannel");
            }

            _configuration = configuration;
            _httpChannel = httpChannel;
            _buildSuccessfulCallback = buildSuccessfulCallback;
            _buildFailedCallback = buildFailedCallback;
            _failedToEvaluateBuildStatus = failedToEvaluateBuildStatus;
        }
 public void Configure(BuildMonitorConfiguration configuration)
 {
     _configuration = configuration;
 }