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
		}
Ejemplo n.º 3
0
        public MainFormController(ICCTrayMultiConfiguration configuration, ISynchronizeInvoke owner)
        {
            this.configuration = configuration;
            monitors           = configuration.GetProjectStatusMonitors();

            for (int i = 0; i < monitors.Length; i++)
            {
                monitors[i] = new SynchronizedProjectMonitor(monitors[i], owner);
            }

            aggregatedMonitor       = new AggregatingProjectMonitor(monitors);
            iconProvider            = new ConfigurableProjectStateIconProvider(configuration.Icons);
            projectStateIconAdaptor = new ProjectStateIconAdaptor(aggregatedMonitor, iconProvider);
            new BuildTransitionSoundPlayer(aggregatedMonitor, new AudioPlayer(), configuration.Audio);
        }
Ejemplo n.º 4
0
        public MainFormController(ICCTrayMultiConfiguration configuration, ISynchronizeInvoke owner)
        {
            this.configuration = configuration;
            monitors = configuration.GetProjectStatusMonitors();

            for (int i = 0; i < monitors.Length; i++)
            {
                monitors[i] = new SynchronizedProjectMonitor(monitors[i], owner);
            }

            aggregatedMonitor = new AggregatingProjectMonitor(monitors);
            iconProvider = new ConfigurableProjectStateIconProvider(configuration.Icons);
            projectStateIconAdaptor = new ProjectStateIconAdaptor(aggregatedMonitor, iconProvider);
            new BuildTransitionSoundPlayer(aggregatedMonitor, new AudioPlayer(), configuration.Audio);
        }
		public void WhenBuildOccurredIsFiredTheDelegateIsInvokedThroughISynchronisedInvoke()
		{
			DynamicMock mockSynchronizeInvoke = new DynamicMock(typeof (ISynchronizeInvoke));
			StubProjectMonitor containedMonitor = new StubProjectMonitor("test");

			SynchronizedProjectMonitor monitor = new SynchronizedProjectMonitor(
				containedMonitor,
				(ISynchronizeInvoke) mockSynchronizeInvoke.MockInstance);

			MonitorBuildOccurredEventHandler delegateToBuildOccurred = new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred);
			monitor.BuildOccurred += delegateToBuildOccurred;

			mockSynchronizeInvoke.Expect("BeginInvoke", delegateToBuildOccurred, new IsTypeOf(typeof (object[])));
			containedMonitor.OnBuildOccurred(new MonitorBuildOccurredEventArgs(null, BuildTransition.StillFailing));

			mockSynchronizeInvoke.Verify();
		}
		public void WhenPolledIsFiredTheDelegateIsInvokedThroughISynchronisedInvoke()
		{
			DynamicMock mockSynchronizeInvoke = new DynamicMock(typeof (ISynchronizeInvoke));
			StubProjectMonitor containedMonitor = new StubProjectMonitor("test");

			SynchronizedProjectMonitor monitor = new SynchronizedProjectMonitor(
				containedMonitor,
				(ISynchronizeInvoke) mockSynchronizeInvoke.MockInstance);

			MonitorPolledEventHandler delegateToPolledMethod = new MonitorPolledEventHandler(Monitor_Polled);
			monitor.Polled += delegateToPolledMethod;

			mockSynchronizeInvoke.Expect("BeginInvoke", delegateToPolledMethod, new IsTypeOf(typeof (object[])));
			containedMonitor.OnPolled(new MonitorPolledEventArgs(containedMonitor));

			mockSynchronizeInvoke.Verify();
		}
		public void MethodsAndPropertiesDoSimpleDelagationOntoInjectedMonitor()
		{
			DynamicMock mockProjectMonitor = new DynamicMock(typeof (IProjectMonitor));

			SynchronizedProjectMonitor monitor = new SynchronizedProjectMonitor(
				(IProjectMonitor) mockProjectMonitor.MockInstance, null);

			mockProjectMonitor.ExpectAndReturn("ProjectState", null);
			Assert.IsNull(monitor.ProjectState);

            Dictionary<string, string> parameters = new Dictionary<string, string>();
			mockProjectMonitor.Expect("ForceBuild", parameters, (string)null);
			monitor.ForceBuild(parameters, null);

			mockProjectMonitor.Expect("Poll");
			monitor.Poll();

			mockProjectMonitor.Verify();
		}