Exemple #1
0
        private void Monitor_Polled(object sender, MonitorPolledEventArgs args)
        {
            String projectName = args.ProjectMonitor.Detail.ProjectName;

            projectName = SpeechUtil.makeProjectNameMoreSpeechFriendly(projectName);

            ProjectState currentState = (ProjectState)projectStates[projectName];
            ProjectState newState     = args.ProjectMonitor.Detail.ProjectState;

            if (currentState == null)
            {
                projectStates.Add(projectName, newState);
            }
            else if (!currentState.Name.Equals(newState.Name))
            {
                projectStates[projectName] = newState;
                if (newState == ProjectState.Building ||
                    newState == ProjectState.BrokenAndBuilding)
                {
                    String            message = string.Format(System.Globalization.CultureInfo.CurrentCulture, "The {0} project has started building", projectName);
                    SpeechSynthesizer speaker = new SpeechSynthesizer();
                    speaker.Speak(message);
                    Trace.WriteLine("speaking: " + message);
                }
            }
        }
Exemple #2
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);
            }
        }