public MainFormController(ICCTrayMultiConfiguration configuration, ISynchronizeInvoke owner, MainForm mainForm)
        {
            this.mainForm      = mainForm;
            this.configuration = configuration;

            serverMonitors = configuration.GetServerMonitors();
            for (int i = 0; i < serverMonitors.Length; i++)
            {
                serverMonitors[i] = new SynchronizedServerMonitor(serverMonitors[i], owner);
            }
            aggregatedServerMonitor = new AggregatingServerMonitor(serverMonitors);
            queueIconProvider       = new ResourceIntegrationQueueIconProvider();

            projectMonitors = configuration.GetProjectStatusMonitors(serverMonitors);
            for (int i = 0; i < projectMonitors.Length; i++)
            {
                projectMonitors[i] = new SynchronizedProjectMonitor(projectMonitors[i], owner);
            }
            aggregatedProjectMonitor = new AggregatingProjectMonitor(projectMonitors);
            projectStateIconProvider = new ConfigurableProjectStateIconProvider(configuration.Icons);
            projectStateIconAdaptor  = new ProjectStateIconAdaptor(aggregatedProjectMonitor, projectStateIconProvider);
            soundPlayer = new BuildTransitionSoundPlayer(aggregatedProjectMonitor, new AudioPlayer(), configuration.Audio);
            execRunner  = new BuildTransitionExecRunner(aggregatedProjectMonitor, configuration.Execs);
            LampController lampController = new LampController(configuration.X10, null);

            x10Controller = new X10Controller(aggregatedProjectMonitor, new DateTimeProvider(), configuration.X10, lampController);

            growlController = new GrowlController(aggregatedProjectMonitor, configuration.Growl);

#if !DISABLE_COM
            IBalloonMessageProvider balloonMessageProvider = new ConfigurableBalloonMessageProvider(configuration.BalloonMessages);
            speakerForTheDead = new SpeakingProjectMonitor(aggregatedProjectMonitor, balloonMessageProvider, configuration.Speech);
#endif
        }
		public MainFormController(ICCTrayMultiConfiguration configuration, ISynchronizeInvoke owner, MainForm mainForm)
		{
            this.mainForm = mainForm;
			this.configuration = configuration;

			serverMonitors = configuration.GetServerMonitors();
			for (int i = 0; i < serverMonitors.Length; i++)
			{
				serverMonitors[i] = new SynchronizedServerMonitor(serverMonitors[i], owner);
			}
			aggregatedServerMonitor = new AggregatingServerMonitor(serverMonitors);
			queueIconProvider = new ResourceIntegrationQueueIconProvider();

			projectMonitors = configuration.GetProjectStatusMonitors(serverMonitors);
			execRunners = new BuildTransitionExecRunner[projectMonitors.Length];
			for (int i = 0; i < projectMonitors.Length; i++)
			{
				execRunners[i] = new BuildTransitionExecRunner(projectMonitors[i], configuration.Execs);
				projectMonitors[i] = new SynchronizedProjectMonitor(projectMonitors[i], owner);
			}
			aggregatedProjectMonitor = new AggregatingProjectMonitor(projectMonitors);
			projectStateIconProvider = new ConfigurableProjectStateIconProvider(configuration.Icons);
			projectStateIconAdaptor = new ProjectStateIconAdaptor(aggregatedProjectMonitor, projectStateIconProvider);
			soundPlayer = new BuildTransitionSoundPlayer(aggregatedProjectMonitor, new AudioPlayer(), configuration.Audio);
			LampController lampController = new LampController(configuration.X10,null);
			x10Controller = new X10Controller(aggregatedProjectMonitor,new DateTimeProvider(),configuration.X10,lampController);
			
			growlController = new GrowlController(aggregatedProjectMonitor, configuration.Growl);

#if !DISABLE_COM
			IBalloonMessageProvider balloonMessageProvider = new ConfigurableBalloonMessageProvider(configuration.BalloonMessages);
			speakerForTheDead = new SpeakingProjectMonitor(aggregatedProjectMonitor, balloonMessageProvider, configuration.Speech);
#endif
		}
		public void ReturnsTheMessagesAndCaptionsDefinedInTheConfiguration()
		{
			BalloonMessages messages = new BalloonMessages();
			ConfigurableBalloonMessageProvider provider = new ConfigurableBalloonMessageProvider(messages);
			
			Assert.AreSame(messages.BrokenBuildMessage, provider.GetCaptionAndMessageForBuildTransition(BuildTransition.Broken));			
			Assert.AreSame(messages.FixedBuildMessage, provider.GetCaptionAndMessageForBuildTransition(BuildTransition.Fixed));			
			Assert.AreSame(messages.StillFailingBuildMessage, provider.GetCaptionAndMessageForBuildTransition(BuildTransition.StillFailing));			
			Assert.AreSame(messages.StillSuccessfulBuildMessage, provider.GetCaptionAndMessageForBuildTransition(BuildTransition.StillSuccessful));			
		}