private void ProjectMonitor_BuildOccurred(object sender, MonitorBuildOccurredEventArgs args)
 {
     if (BuildOccurred != null)
     {
         synchronizeInvoke.BeginInvoke(BuildOccurred, new object[] { sender, args });
     }
 }
 public void OnBuildOccurred(MonitorBuildOccurredEventArgs args)
 {
     if (BuildOccurred != null)
     {
         BuildOccurred(this, args);
     }
 }
Esempio n. 3
0
        private void Monitor_BuildOccurred(object sender, MonitorBuildOccurredEventArgs e)
        {
            string soundFileToPlay = ChooseSoundFile(e.BuildTransition);

            if (soundFileToPlay == null || soundFileToPlay.Length == 0)
            {
                return;
            }

            audioPlayer.Play(soundFileToPlay);
        }
Esempio n. 4
0
        private void Monitor_BuildOccurred(object sender, MonitorBuildOccurredEventArgs e)
        {
            string projectName = e.ProjectMonitor.Detail.ProjectName;

            CaptionAndMessage captionAndMessage = balloonMessageProvider.GetCaptionAndMessageForBuildTransition(e.BuildTransition);
            string            caption           = string.Format("{0}: {1}",
                                                                projectName, captionAndMessage.Caption);

            ShowBalloon(caption, captionAndMessage.Message,
                        e.BuildTransition.ErrorLevel.NotifyInfo, 5000);
        }
Esempio n. 5
0
        private void Monitor_BuildOccurred(object sender, MonitorBuildOccurredEventArgs e)
        {
            if (SpeechUtil.shouldSpeak(e.BuildTransition, speakBuildSucceded, speakBuildFailed))
            {
                String projectName = e.ProjectMonitor.Detail.ProjectName;
                projectName = SpeechUtil.makeProjectNameMoreSpeechFriendly(projectName);

                CaptionAndMessage captionAndMessage = balloonMessageProvider.GetCaptionAndMessageForBuildTransition(e.BuildTransition);
                String            message           = string.Format(System.Globalization.CultureInfo.CurrentCulture, "The {0} project reports {1}", projectName, captionAndMessage.Message);
                SpeechSynthesizer speaker           = new SpeechSynthesizer();
                speaker.Speak(message);
                Trace.WriteLine("speaking: " + message);
            }
        }
        private void ProjectMonitor_BuildOccurred(object sender, MonitorBuildOccurredEventArgs args)
        {
            if (BuildOccurred != null)
            {
                var canInvoke = true;
                if (synchronizeInvoke is Control)
                {
                    canInvoke = !(synchronizeInvoke as Control).IsDisposed;
                }

                if (canInvoke)
                {
                    synchronizeInvoke.BeginInvoke(BuildOccurred, new object[] { sender, args });
                }
            }
        }
Esempio n. 7
0
        private void Monitor_BuildOccurred(object sender, MonitorBuildOccurredEventArgs e)
        {
            if (e.BuildTransition.ErrorLevel.NotifyInfo < this.configuration.MinimumNotificationLevel)
            {
                return;
            }

            string projectName = e.ProjectMonitor.Detail.ProjectName;


            CaptionAndMessage captionAndMessage = GetCaptionAndMessageForBuildTransition(e.BuildTransition);
            string            caption           = string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0}: {1} ",
                                                                projectName, captionAndMessage.Caption);

            Notification notification = new Notification(ApplicationName, captionAndMessage.Caption, null, projectName, captionAndMessage.Message);

            growl.Notify(notification);
        }
        public void BuildOccuredIsFiredWheneverAnyContainedProjectStatusFiresIt()
        {
            buildOccurredCount         = 0;
            lastBuildOccurredEventArgs = null;

            StubProjectMonitor stubProjectMonitor1 = new StubProjectMonitor("project1");
            StubProjectMonitor stubProjectMonitor2 = new StubProjectMonitor("project2");

            aggregator = new AggregatingProjectMonitor(stubProjectMonitor1, stubProjectMonitor2);
            aggregator.BuildOccurred += new MonitorBuildOccurredEventHandler(Aggregator_BuildOccurred);

            Assert.AreEqual(0, buildOccurredCount);
            stubProjectMonitor1.OnBuildOccurred(new MonitorBuildOccurredEventArgs(stubProjectMonitor1, BuildTransition.Fixed));

            Assert.AreEqual(1, buildOccurredCount);
            Assert.AreSame(stubProjectMonitor1, lastBuildOccurredEventArgs.ProjectMonitor);
            Assert.AreEqual(BuildTransition.Fixed, lastBuildOccurredEventArgs.BuildTransition);
        }
Esempio n. 9
0
        private void Monitor_BuildOccurred(object sender, MonitorBuildOccurredEventArgs e)
        {
            if (e.BuildTransition.ErrorLevel.NotifyInfo < minimumNotificationLevel)
            {
                return;
            }

            string projectName = e.ProjectMonitor.Detail.ProjectName;

            CaptionAndMessage captionAndMessage = balloonMessageProvider.GetCaptionAndMessageForBuildTransition(e.BuildTransition);
            string            caption           = string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0}: {1} ",
                                                                projectName, captionAndMessage.Caption);

            trayIcon.ShowBalloonTip(
                5000,
                caption,
                captionAndMessage.Message,
                e.BuildTransition.ErrorLevel.NotifyInfo);
        }
 private void Monitor_BuildOccurred(object sender, MonitorBuildOccurredEventArgs e)
 {
     Assert.Fail("Do not expect this method to actually get called as using mcoked synchronised invoke");
 }
 private void Monitor_BuildOccurred(object sauce, MonitorBuildOccurredEventArgs e)
 {
     buildOccurredCount++;
     lastBuildOccurredArgs = e;
 }