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 GrowlController(IProjectMonitor monitor, GrowlConfiguration configuration) { this.configuration = configuration; this.monitor = monitor; this.InitializeLibrary(); this.InitializeGrowlInstance(); }
// callback for when user has entered a pattern to create a new tablist from void doneTextEdit(Control[] t) { string pattern = t[0].Text.ToUpper(); CCProjectsView view = new CCProjectsView(this, string.Empty); AddView(view); foreach (ListViewItem lvi in m_current.ListView.Items) { string s = lvi.SubItems[0].Text.ToUpper() + lvi.SubItems[1].Text.ToUpper(); if (s.Contains(pattern)) { IProjectMonitor monitor = (IProjectMonitor)lvi.Tag; ListViewItem item = mainForm.MainFormController.CopyBoundProject(monitor); view.AddProject(item); } } TabControl.SelectedTab = view.TabPage; view.TabPage.Text = t[0].Text; view.Text = t[0].Text; m_current = view; Rectangle rect = TabControl.GetTabRect(TabControl.SelectedIndex); Point p = new Point(rect.Left, rect.Top); if (m_bUsingTextBox == false) { RenameView(p, view.TabPage.Text, new Control[] { view, view.TabPage }, null); } }
public GrowlController(IProjectMonitor monitor, GrowlConfiguration configuration) { this.configuration = configuration; this.monitor = monitor; this.InitializeLibrary(); this.InitializeGrowlInstance(); }
void projMon_Polled(object sender, MonitorPolledEventArgs args) { IProjectMonitor projMon = args.ProjectMonitor; if ((projMon.ProjectState != ProjectState.Success && projMon.ProjectState != ProjectState.NotConnected && projMon.ProjectState != ProjectState.Building) || projMon.ProjectState == ProjectState.BrokenAndBuilding) { ListViewItem item = m_viewMgr.MainForm.MainFormController.CopyBoundProject(projMon); m_viewMgr.m_broken.AddProject(item); if (m_viewMgr.TabControl.TabPages.Contains(m_viewMgr.m_broken.TabPage) == false) { m_viewMgr.TabControl.TabPages.Add(m_viewMgr.m_broken.TabPage); } } else { foreach (ListViewItem srclvi in m_viewMgr.m_broken.ListView.Items) { if (srclvi != null && srclvi.Tag == projMon) { m_viewMgr.m_broken.ListView.Items.Remove(srclvi); } } if (m_viewMgr.m_broken.ListView.Items.Count == 0) { m_viewMgr.TabControl.TabPages.Remove(m_viewMgr.m_broken.TabPage); } } }
public IProjectMonitor[] GetProjectStatusMonitors(ISingleServerMonitor[] serverMonitors) { int indexRetval = 0; ArrayList indexList = new ArrayList(); for (int i = 0; i < Projects.Length; i++) { if (Projects[i].ShowProject) { indexList.Add(i); } } IProjectMonitor[] retVal = new IProjectMonitor[indexList.Count]; foreach (int i in indexList) { if (Projects[i].ShowProject) { ICruiseProjectManager projectManager = cruiseProjectManagerFactory.Create(Projects[i], serverManagersList); ISingleServerMonitor serverMonitor = GetServerMonitorForProject(Projects[i], serverMonitors); retVal[indexRetval++] = new ProjectMonitor(Projects[i], projectManager, serverMonitor); } } return(retVal); }
void TabControl_DragDrop(object sender, DragEventArgs e) { Point p = m_tabControl.PointToClient(new Point(e.X, e.Y)); // probably shouldn't need to do this TabPage t = FindTabControl(p); if (t != null) { if (m_tabControl.SelectedTab != t) { Console.WriteLine("Ouch trying to drop onto a tab which isn't selected!!!"); } } e.Effect = DragDropEffects.Copy; if (e.Data.GetDataPresent(typeof(ListView.SelectedListViewItemCollection)) == false) { Console.WriteLine("no data"); } ListView.SelectedListViewItemCollection items = (ListView.SelectedListViewItemCollection)e.Data.GetData(typeof(ListView.SelectedListViewItemCollection)); foreach (ListViewItem lvi in items) { IProjectMonitor monitor = (IProjectMonitor)lvi.Tag; ListViewItem item = mainForm.MainFormController.CopyBoundProject(monitor); m_current.AddProject(item); } }
public BuildTransitionExecRunner(IProjectMonitor monitor, ExecCommands configuration) { this.monitor = monitor; this.configuration = configuration; monitor.Polled += Monitor_Polled; }
public BuildTransitionExecRunner(IProjectMonitor monitor, ExecCommands configuration) { this.monitor = monitor; this.configuration = configuration; monitor.Polled += Monitor_Polled; }
public SynchronizedProjectMonitor(IProjectMonitor projectMonitor, ISynchronizeInvoke synchronizeInvoke) { this.projectMonitor = projectMonitor; this.synchronizeInvoke = synchronizeInvoke; projectMonitor.Polled += new MonitorPolledEventHandler(ProjectMonitor_Polled); projectMonitor.BuildOccurred += new MonitorBuildOccurredEventHandler(ProjectMonitor_BuildOccurred); }
public void BindToProjectMonitor(IProjectMonitor monitor, bool showBalloonMessages) { this.monitor = monitor; monitor.Polled += new MonitorPolledEventHandler(Monitor_Polled); if (showBalloonMessages) monitor.BuildOccurred += new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred); }
public SynchronizedProjectMonitor(IProjectMonitor projectMonitor, ISynchronizeInvoke synchronizeInvoke) { this.projectMonitor = projectMonitor; this.synchronizeInvoke = synchronizeInvoke; projectMonitor.Polled += new MonitorPolledEventHandler(ProjectMonitor_Polled); projectMonitor.BuildOccurred += new MonitorBuildOccurredEventHandler(ProjectMonitor_BuildOccurred); }
public ProjectStateIconAdaptor( IProjectMonitor monitor, IProjectStateIconProvider iconProvider ) { this.monitor = monitor; this.iconProvider = iconProvider; UpdateIcon(); monitor.Polled += new MonitorPolledEventHandler( Monitor_Polled ); }
public ProjectStateIconAdaptor(IProjectMonitor monitor, IProjectStateIconProvider iconProvider) { this.monitor = monitor; this.iconProvider = iconProvider; UpdateIcon(); monitor.Polled += Monitor_Polled; }
public ProjectStateIconAdaptor(IProjectMonitor monitor, IProjectStateIconProvider iconProvider) { this.monitor = monitor; this.iconProvider = iconProvider; UpdateIcon(); monitor.Polled += new MonitorPolledEventHandler(Monitor_Polled); }
public ProjectStateIconAdaptor( IProjectMonitor monitor, IProjectStateIconProvider iconProvider ) { this.monitor = monitor; this.iconProvider = iconProvider; UpdateIcon(); monitor.Polled += Monitor_Polled; }
public void BindToProjectMonitor(IProjectMonitor monitor, bool showBalloonMessages) { this.monitor = monitor; monitor.Polled += new MonitorPolledEventHandler(Monitor_Polled); if (showBalloonMessages) { monitor.BuildOccurred += new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred); } }
public ListViewItem Create(IProjectMonitor projectMonitor) { projectMonitor.Polled += new MonitorPolledEventHandler(Monitor_Polled); item.Text = projectMonitor.Detail.ProjectName; DisplayProjectStateInListViewItem(projectMonitor); return(item); }
public ListViewItem Create(IProjectMonitor projectMonitor) { projectMonitor.Polled += new MonitorPolledEventHandler(Monitor_Polled); item.Text = projectMonitor.Detail.ProjectName; DisplayProjectStateInListViewItem(projectMonitor); return item; }
public IProjectMonitor[] GetProjectStatusMonitors() { IProjectMonitor[] retVal = new IProjectMonitor[Projects.Length]; for (int i = 0; i < Projects.Length; i++) { Project project = Projects[i]; ICruiseProjectManager projectManager = managerFactory.Create(project.ServerUrl, project.ProjectName); retVal[i] = new ProjectMonitor(projectManager); } return(retVal); }
public IProjectMonitor[] GetProjectStatusMonitors() { IProjectMonitor[] retVal = new IProjectMonitor[Projects.Length]; for (int i = 0; i < Projects.Length; i++) { Project project = Projects[i]; ICruiseProjectManager projectManager = managerFactory.Create(project.ServerUrl, project.ProjectName); retVal[i] = new ProjectMonitor(projectManager); } return retVal; }
public void BindToProjectMonitor(IProjectMonitor monitor, bool showBalloonMessages, ToolTipIcon minimumNotificationLevel) { this.monitor = monitor; monitor.Polled += Monitor_Polled; this.minimumNotificationLevel = minimumNotificationLevel; if (showBalloonMessages) { monitor.BuildOccurred += Monitor_BuildOccurred; monitor.MessageReceived += Monitor_MessageReceived; } }
public void BindToProjectMonitor(IProjectMonitor monitor, bool showBalloonMessages, ToolTipIcon minimumNotificationLevel) { this.monitor = monitor; monitor.Polled += Monitor_Polled; this.minimumNotificationLevel = minimumNotificationLevel; if (showBalloonMessages) { monitor.BuildOccurred += Monitor_BuildOccurred; monitor.MessageReceived += Monitor_MessageReceived; } }
private void ToolStripMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem tsi = (ToolStripMenuItem)sender; CCProjectsView ccpv = (CCProjectsView)tsi.Tag; foreach (ListViewItem lvi in m_current.ListView.SelectedItems) { IProjectMonitor monitor = (IProjectMonitor)lvi.Tag; ListViewItem item = mainForm.MainFormController.CopyBoundProject(monitor); ccpv.AddProject(item); } }
public X10Controller(IProjectMonitor monitor, DateTimeProvider dateTimeProvider, X10Configuration configuration, ILampController lampController) { if (configuration != null && configuration.Enabled) { Trace.WriteLine("New X10Controller created"); this.lampController = lampController; this.dateTimeProvider = dateTimeProvider; this.configuration = configuration; this.monitor = monitor; monitor.Polled += new MonitorPolledEventHandler(Monitor_Polled); } }
public X10Controller(IProjectMonitor monitor, DateTimeProvider dateTimeProvider, X10Configuration configuration, ILampController lampController) { if (configuration != null && configuration.Enabled) { Trace.WriteLine("New X10Controller created"); this.lampController = lampController; this.dateTimeProvider = dateTimeProvider; this.configuration = configuration; this.monitor = monitor; monitor.Polled += new MonitorPolledEventHandler(Monitor_Polled); } }
public List <ParameterBase> ListBuildParameters() { IProjectMonitor project = SelectedProject; if (project != null) { return(SelectedProject.ListBuildParameters()); } else { return(null); } }
public BuildTransitionSoundPlayer(IProjectMonitor monitor, IAudioPlayer audioPlayer, AudioFiles configuration) { this.audioPlayer = audioPlayer; if (configuration != null) { soundFileLookup[BuildTransition.Broken] = configuration.BrokenBuildSound; soundFileLookup[BuildTransition.Fixed] = configuration.FixedBuildSound; soundFileLookup[BuildTransition.StillFailing] = configuration.StillFailingBuildSound; soundFileLookup[BuildTransition.StillSuccessful] = configuration.StillSuccessfulBuildSound; } monitor.BuildOccurred += new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred); }
public BuildTransitionSoundPlayer(IProjectMonitor monitor, IAudioPlayer audioPlayer, AudioFiles configuration) { this.audioPlayer = audioPlayer; if (configuration != null) { soundFileLookup[BuildTransition.Broken] = configuration.BrokenBuildSound; soundFileLookup[BuildTransition.Fixed] = configuration.FixedBuildSound; soundFileLookup[BuildTransition.StillFailing] = configuration.StillFailingBuildSound; soundFileLookup[BuildTransition.StillSuccessful] = configuration.StillSuccessfulBuildSound; } monitor.BuildOccurred += new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred); }
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 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 GPIOController(IProjectMonitor monitor, GPIOConfiguration configuration) { this._Monitor = monitor; this._Configuration = configuration; this._Mapper = new GPIOPinMapper(); this._Mapper.DisableAllPins(); this._Monitor.Polled += new MonitorPolledEventHandler(_Monitor_Polled); _Map.Add(ProjectState.Broken, (c) => c.BrokenPins); _Map.Add(ProjectState.BrokenAndBuilding, (c) => c.BrokenBuildingPins); _Map.Add(ProjectState.Building, (c) => c.BuildingPins); _Map.Add(ProjectState.NotConnected, (c) => c.NotConnectedPins); _Map.Add(ProjectState.Success, (c) => c.SuccessPins); _Mapper.EnablePins(_Map[ProjectState.NotConnected](_Configuration)); }
private void DisplayProjectStateInListViewItem(IProjectMonitor monitor) { item.ImageIndex = monitor.ProjectState.ImageIndex; if (monitor.Detail.IsConnected) { lastBuildLabel.Text = monitor.Detail.LastBuildLabel; lastBuildTime.Text = monitor.Detail.LastBuildTime.ToString(); activity.Text = monitor.Detail.Activity.ToString(); } else { activity.Text = lastBuildLabel.Text = ""; } detail.Text = detailStringProvider.FormatDetailString(monitor.Detail); }
public void AddProject(ListViewItem lvi) { try { if (m_listView.Items != null && m_listView.Items.Contains(lvi) == false && Contains(lvi) == false) { m_listView.Items.Add(lvi); IProjectMonitor projMon = (IProjectMonitor)lvi.Tag; projMon.Polled -= projMon_Polled; projMon.Polled += new MonitorPolledEventHandler(projMon_Polled); } } catch (System.Exception) { } }
private void DisplayProjectStateInListViewItem(IProjectMonitor monitor) { item.ImageIndex = monitor.ProjectState.ImageIndex; if (monitor.Detail.IsConnected) { lastBuildLabel.Text = monitor.Detail.LastBuildLabel; lastBuildTime.Text = monitor.Detail.LastBuildTime.ToString(); activity.Text = monitor.Detail.Activity.ToString(); } else { activity.Text = lastBuildLabel.Text = ""; } detail.Text = detailStringProvider.FormatDetailString(monitor.Detail); }
public SpeakingProjectMonitor (IProjectMonitor monitor, IBalloonMessageProvider balloonMessageProvider, SpeechConfiguration configuration) { this.monitor = monitor; this.balloonMessageProvider = balloonMessageProvider; if (configuration != null && configuration.Enabled) { speakBuildSucceded = configuration.SpeakBuildSucceded; speakBuildFailed = configuration.SpeakBuildFailed; if (speakBuildSucceded || speakBuildFailed) { monitor.BuildOccurred += new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred); } if (configuration.SpeakBuildStarted) { monitor.Polled += new MonitorPolledEventHandler(Monitor_Polled); } } }
void lv_DragDrop(object sender, DragEventArgs e) { e.Effect = DragDropEffects.Copy; if (e.Data.GetDataPresent(typeof(ListView.SelectedListViewItemCollection)) == false) { return; } ListView.SelectedListViewItemCollection items = (ListView.SelectedListViewItemCollection)e.Data.GetData(typeof(ListView.SelectedListViewItemCollection)); foreach (ListViewItem lvi in items) { IProjectMonitor monitor = (IProjectMonitor)lvi.Tag; ListViewItem item = m_viewMgr.MainForm.MainFormController.CopyBoundProject(monitor); AddProject(item); } }
public SpeakingProjectMonitor(IProjectMonitor monitor, IBalloonMessageProvider balloonMessageProvider, SpeechConfiguration configuration) { this.monitor = monitor; this.balloonMessageProvider = balloonMessageProvider; if (configuration != null && configuration.Enabled) { speakBuildSucceded = configuration.SpeakBuildSucceded; speakBuildFailed = configuration.SpeakBuildFailed; if (speakBuildSucceded || speakBuildFailed) { monitor.BuildOccurred += new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred); } if (configuration.SpeakBuildStarted) { monitor.Polled += new MonitorPolledEventHandler(Monitor_Polled); } } }
public void SetUp() { mockProjectMonitor = new Mock <IProjectMonitor>(MockBehavior.Strict); projectMonitor = (IProjectMonitor)mockProjectMonitor.Object; mockConfiguration = new Mock <ICCTrayMultiConfiguration>(); configuration = (ICCTrayMultiConfiguration)mockConfiguration.Object; ISingleServerMonitor[] serverMonitors = new ISingleServerMonitor[0]; mockConfiguration.Setup(_configuration => _configuration.GetServerMonitors()).Returns(serverMonitors); mockConfiguration.Setup(_configuration => _configuration.GetProjectStatusMonitors(It.IsAny <ISingleServerMonitor[]>())).Returns(new IProjectMonitor[0]); mockConfiguration.SetupGet(_configuration => _configuration.Icons).Returns(new Icons()); mockConfiguration.SetupGet(_configuration => _configuration.FixUserName).Returns("John"); GrowlConfiguration growlConfig = new GrowlConfiguration(); mockConfiguration.SetupGet(_configuration => _configuration.Growl).Returns(growlConfig); eventCount = 0; controller = new MainFormController(configuration, null, null); }
public void SetUp() { mockProjectMonitor = new DynamicMock(typeof (IProjectMonitor)); mockProjectMonitor.Strict = true; projectMonitor = (IProjectMonitor) mockProjectMonitor.MockInstance; mockConfiguration = new DynamicMock(typeof (ICCTrayMultiConfiguration)); configuration = (ICCTrayMultiConfiguration) mockConfiguration.MockInstance; ISingleServerMonitor[] serverMonitors = new ISingleServerMonitor[0]; mockConfiguration.SetupResult("GetServerMonitors", serverMonitors); mockConfiguration.SetupResult("GetProjectStatusMonitors", new IProjectMonitor[0], typeof(ISingleServerMonitor[])); mockConfiguration.SetupResult("Icons", new Icons()); mockConfiguration.SetupResult("FixUserName", "John"); GrowlConfiguration growlConfig = new GrowlConfiguration(); mockConfiguration.SetupResult("Growl", growlConfig); eventCount = 0; controller = new MainFormController(configuration, null, null); }
public void UpdateTabPageIcons(CCProjectsView view) { try { ProjectState worstStatus = ProjectState.Success; ListView.CheckForIllegalCrossThreadCalls = false; foreach (ListViewItem lvi in view.ListView.Items) { IProjectMonitor projMon = (IProjectMonitor)lvi.Tag; if (projMon.ProjectState.IsMoreImportantThan(worstStatus)) { worstStatus = projMon.ProjectState; } } view.TabPage.ImageIndex = worstStatus.ImageIndex; } catch (System.Exception e) { } }
private void DisplayProjectStateInListViewItem(IProjectMonitor monitor) { item.ImageIndex = monitor.ProjectState.ImageIndex; if (monitor.Detail.IsConnected) { if (config != null) { foreach (CCTrayProject project in config.Projects) { if ((project.ProjectName == monitor.Detail.ProjectName) // add by rei , fixes issue with displaying wrong server in cctray, while multiple configured server // having project with the same project name && (project.BuildServer.DisplayName == monitor.Detail.Configuration.BuildServer.DisplayName)) { serverName.Text = project.BuildServer.DisplayName; } } } else { serverName.Text = new Uri(monitor.Detail.WebURL).Host; } lastBuildLabel.Text = monitor.Detail.LastBuildLabel; lastBuildTime.Text = monitor.Detail.LastBuildTime.ToString(); projectStatus.Text = monitor.ProjectIntegratorState; activity.Text = monitor.Detail.Activity.ToString(); category.Text = monitor.Detail.Category; qName.Text = monitor.Detail.QueueName; qPriority.Text = monitor.Detail.QueuePriority.ToString("D8"); } else { activity.Text = lastBuildLabel.Text = string.Empty; } detail.Text = detailStringProvider.FormatDetailString(monitor.Detail); }
public void SetUp() { mockProjectMonitor = new DynamicMock(typeof(IProjectMonitor)); mockProjectMonitor.Strict = true; projectMonitor = (IProjectMonitor)mockProjectMonitor.MockInstance; mockConfiguration = new DynamicMock(typeof(ICCTrayMultiConfiguration)); configuration = (ICCTrayMultiConfiguration)mockConfiguration.MockInstance; ISingleServerMonitor[] serverMonitors = new ISingleServerMonitor[0]; mockConfiguration.SetupResult("GetServerMonitors", serverMonitors); mockConfiguration.SetupResult("GetProjectStatusMonitors", new IProjectMonitor[0], typeof(ISingleServerMonitor[])); mockConfiguration.SetupResult("Icons", new Icons()); mockConfiguration.SetupResult("FixUserName", "John"); GrowlConfiguration growlConfig = new GrowlConfiguration(); mockConfiguration.SetupResult("Growl", growlConfig); eventCount = 0; controller = new MainFormController(configuration, null, null); }
private void DisplayProjectStateInListViewItem(IProjectMonitor monitor) { item.ImageIndex = monitor.ProjectState.ImageIndex; if (monitor.Detail.IsConnected) { if (config != null) { foreach (CCTrayProject project in config.Projects) { if ((project.ProjectName == monitor.Detail.ProjectName) // add by rei , fixes issue with displaying wrong server in cctray, while multiple configured server // having project with the same project name && (project.BuildServer.DisplayName == monitor.Detail.Configuration.BuildServer.DisplayName)) { serverName.Text = project.BuildServer.DisplayName; } } } else { serverName.Text = new Uri(monitor.Detail.WebURL).Host; } lastBuildLabel.Text = monitor.Detail.LastBuildLabel; lastBuildTime.Text = monitor.Detail.LastBuildTime.ToString(); projectStatus.Text = monitor.ProjectIntegratorState; activity.Text = monitor.Detail.Activity.ToString(); category.Text = monitor.Detail.Category; qName.Text = monitor.Detail.QueueName; qPriority.Text = monitor.Detail.QueuePriority.ToString("D8"); } else { activity.Text = lastBuildLabel.Text = string.Empty; } detail.Text = detailStringProvider.FormatDetailString(monitor.Detail); }
void mnuSendToNewTab_Click(object sender, EventArgs e) { CCProjectsView view = new CCProjectsView(this, string.Empty); AddView(view); foreach (ListViewItem lvi in m_current.ListView.SelectedItems) { IProjectMonitor monitor = (IProjectMonitor)lvi.Tag; ListViewItem item = mainForm.MainFormController.CopyBoundProject(monitor); view.AddProject(item); } TabControl.SelectedTab = view.TabPage; m_current = view; Rectangle rect = TabControl.GetTabRect(TabControl.SelectedIndex); Point p = new Point(rect.Left, rect.Top); if (m_bUsingTextBox == false) { RenameView(p, view.TabPage.Text, new Control[] { view, view.TabPage }, null); } }
public IProjectMonitor[] GetProjectStatusMonitors(ISingleServerMonitor[] serverMonitors) { int indexRetval = 0; ArrayList indexList = new ArrayList(); for (int i = 0; i < Projects.Length; i++) { if (Projects[i].ShowProject) indexList.Add(i); } IProjectMonitor[] retVal = new IProjectMonitor[indexList.Count]; foreach (int i in indexList) { if (Projects[i].ShowProject) { ICruiseProjectManager projectManager = cruiseProjectManagerFactory.Create(Projects[i], serverManagersList); ISingleServerMonitor serverMonitor = GetServerMonitorForProject(Projects[i], serverMonitors); retVal[indexRetval++] = new ProjectMonitor(Projects[i], projectManager, serverMonitor); } } return retVal; }
public MonitorBuildOccurredEventArgs(IProjectMonitor projectMonitor, BuildTransition buildTransition) { ProjectMonitor = projectMonitor; BuildTransition = buildTransition; }
public void CancelPendingProjectByName(string projectName) { foreach (IProjectMonitor projectMonitor in projectMonitors) { if (projectMonitor.Detail.ProjectName == projectName) { SelectedProject = projectMonitor; RunSecureMethod(b => { CancelPending(); }, "CancelPending"); break; } } }
public MonitorPolledEventArgs( IProjectMonitor projectMonitor ) { ProjectMonitor = projectMonitor; }
public PackagesListForm(IProjectMonitor project) { InitializeComponent(); Project = project; }
public PackagesListForm(IProjectMonitor project) { InitializeComponent(); Project = project; }
public MonitorPolledEventArgs(IProjectMonitor projectMonitor) { ProjectMonitor = projectMonitor; }
public CurrentStatusWindow(IProjectMonitor projectToMonitor) { InitializeComponent(); ProjectToMonitor = projectToMonitor; }