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 OnCreationTheCurrentStateOfTheIconIsRead() { StatusIcon icon = new StatusIcon(); mockIconProvider.ExpectAndReturn( "GetStatusIconForState", icon, ProjectState.Building ); ProjectStateIconAdaptor adaptor = new ProjectStateIconAdaptor( monitor, iconProvider ); Assert.AreSame( icon, adaptor.StatusIcon ); mockIconProvider.Verify(); }
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 WhenTheMonitorPollsTheIconMayBeUpdated() { StatusIcon icon = new StatusIcon(); mockIconProvider.ExpectAndReturn( "GetStatusIconForState", icon, ProjectState.Building ); ProjectStateIconAdaptor adaptor = new ProjectStateIconAdaptor( monitor, iconProvider ); Assert.AreSame( icon, adaptor.StatusIcon ); monitor.ProjectState = ProjectState.Broken; StatusIcon icon2 = new StatusIcon(); mockIconProvider.ExpectAndReturn( "GetStatusIconForState", icon2, ProjectState.Broken ); monitor.Poll(); Assert.AreSame( icon2, adaptor.StatusIcon ); mockIconProvider.Verify(); }
public void WhenTheStatusIconIsChangedAnEventIsFired() { iconChangedCount = 0; StatusIcon icon = new StatusIcon(); mockIconProvider.ExpectAndReturn( "GetStatusIconForState", icon, ProjectState.Building ); ProjectStateIconAdaptor adaptor = new ProjectStateIconAdaptor( monitor, iconProvider ); adaptor.IconChanged += new EventHandler(IconChanged); Assert.AreEqual(0,iconChangedCount); StatusIcon icon2 = new StatusIcon(); adaptor.StatusIcon = icon2; Assert.AreEqual(1,iconChangedCount); adaptor.StatusIcon = icon2; Assert.AreEqual(1,iconChangedCount); }