public void BindToQueueTreeView(QueueTreeView treeView) { StartProjectMonitoring(); treeView.BeginUpdate(); treeView.Nodes.Clear(); foreach (ISingleServerMonitor monitor in serverMonitors) { IntegrationQueueTreeNodeAdaptor adaptor = new IntegrationQueueTreeNodeAdaptor(monitor); TreeNode serverTreeNode = adaptor.Create(); treeView.Nodes.Add(serverTreeNode); monitor.ServerSnapshotChanged += HandleServerSnapshotChange; } treeView.EndUpdate(); if (treeView.Nodes.Count > 0) { treeView.SelectedNode = treeView.Nodes[0]; } }
public void UnbindToQueueTreeView(QueueTreeView treeView) { treeView.BeginUpdate(); foreach (TreeNode node in treeView.Nodes) { IntegrationQueueTreeNodeAdaptor adaptor = node.Tag as IntegrationQueueTreeNodeAdaptor; if (adaptor != null) { adaptor.Detach(); } } treeView.Nodes.Clear(); treeView.EndUpdate(); foreach (ISingleServerMonitor monitor in serverMonitors) { monitor.ServerSnapshotChanged -= HandleServerSnapshotChange; } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Windows.Forms.MenuItem menuItem1; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.mnuAbout = new System.Windows.Forms.MenuItem(); this.lvProjects = new System.Windows.Forms.ListView(); this.colProject = new System.Windows.Forms.ColumnHeader(); this.colServer = new System.Windows.Forms.ColumnHeader(); this.colCategory = new System.Windows.Forms.ColumnHeader(); this.colActivity = new System.Windows.Forms.ColumnHeader(); this.colDetail = new System.Windows.Forms.ColumnHeader(); this.colLastBuildLabel = new System.Windows.Forms.ColumnHeader(); this.colLastBuildTime = new System.Windows.Forms.ColumnHeader(); this.colProjectStatus = new System.Windows.Forms.ColumnHeader(); this.colQName = new System.Windows.Forms.ColumnHeader(); this.colQPriority = new System.Windows.Forms.ColumnHeader(); this.projectContextMenu = new System.Windows.Forms.ContextMenu(); this.mnuForce = new System.Windows.Forms.MenuItem(); this.mnuAbort = new System.Windows.Forms.MenuItem(); this.mnuStart = new System.Windows.Forms.MenuItem(); this.mnuStop = new System.Windows.Forms.MenuItem(); this.mnuWebPage = new System.Windows.Forms.MenuItem(); this.mnuCancelPending = new System.Windows.Forms.MenuItem(); this.mnuFixBuild = new System.Windows.Forms.MenuItem(); this.mnuCopyBuildLabel = new System.Windows.Forms.MenuItem(); this.currentStatusMenu = new System.Windows.Forms.MenuItem(); this.packagesMenu = new System.Windows.Forms.MenuItem(); this.largeIconList = new System.Windows.Forms.ImageList(this.components); this.iconList = new System.Windows.Forms.ImageList(this.components); this.mainMenu = new System.Windows.Forms.MainMenu(this.components); this.menuFile = new System.Windows.Forms.MenuItem(); this.mnuFilePreferences = new System.Windows.Forms.MenuItem(); this.menuItem3 = new System.Windows.Forms.MenuItem(); this.menuFileExit = new System.Windows.Forms.MenuItem(); this.mnuView = new System.Windows.Forms.MenuItem(); this.mnuViewIcons = new System.Windows.Forms.MenuItem(); this.mnuViewList = new System.Windows.Forms.MenuItem(); this.mnuViewDetails = new System.Windows.Forms.MenuItem(); this.mnuTrayContextMenu = new System.Windows.Forms.ContextMenu(); this.mnuTraySettings = new System.Windows.Forms.MenuItem(); this.mnuShow = new System.Windows.Forms.MenuItem(); this.menuItem5 = new System.Windows.Forms.MenuItem(); this.mnuTrayExit = new System.Windows.Forms.MenuItem(); this.pnlButtons = new System.Windows.Forms.Panel(); this.btnToggleQueueView = new System.Windows.Forms.Button(); this.btnForceBuild = new System.Windows.Forms.Button(); this.btnStartStopProject = new System.Windows.Forms.Button(); this.splitterQueueView = new System.Windows.Forms.Splitter(); this.pnlViewQueues = new System.Windows.Forms.Panel(); this.queueIconList = new System.Windows.Forms.ImageList(this.components); this.queueContextMenu = new System.Windows.Forms.ContextMenu(); this.mnuQueueCancelPending = new System.Windows.Forms.MenuItem(); this.tltBuildStage = new System.Windows.Forms.ToolTip(this.components); this.serverChangedPanel = new System.Windows.Forms.Panel(); this.closeUpdateButton = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.updateProjectsButton = new System.Windows.Forms.Button(); this.updateProjectsMessage = new System.Windows.Forms.Label(); this.trayIcon = new System.Windows.Forms.NotifyIcon(this.components); this.queueTreeView = new ThoughtWorks.CruiseControl.CCTrayLib.Presentation.QueueTreeView(); menuItem1 = new System.Windows.Forms.MenuItem(); this.pnlButtons.SuspendLayout(); this.pnlViewQueues.SuspendLayout(); this.serverChangedPanel.SuspendLayout(); this.SuspendLayout(); // // menuItem1 // menuItem1.Index = 2; menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuAbout}); menuItem1.Text = "&Help"; // // mnuAbout // this.mnuAbout.Index = 0; this.mnuAbout.Text = "&About"; this.mnuAbout.Click += new System.EventHandler(this.mnuAbout_Click); // // lvProjects // this.lvProjects.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.colProject, this.colServer, this.colCategory, this.colActivity, this.colDetail, this.colLastBuildLabel, this.colLastBuildTime, this.colProjectStatus, this.colQName, this.colQPriority}); this.lvProjects.ContextMenu = this.projectContextMenu; this.lvProjects.Dock = System.Windows.Forms.DockStyle.Fill; this.lvProjects.FullRowSelect = true; this.lvProjects.HideSelection = false; this.lvProjects.LargeImageList = this.largeIconList; this.lvProjects.Location = new System.Drawing.Point(203, 38); this.lvProjects.MultiSelect = false; this.lvProjects.Name = "lvProjects"; this.lvProjects.Size = new System.Drawing.Size(972, 188); this.lvProjects.SmallImageList = this.iconList; this.lvProjects.TabIndex = 0; this.lvProjects.UseCompatibleStateImageBehavior = false; this.lvProjects.View = System.Windows.Forms.View.Details; this.lvProjects.SelectedIndexChanged += new System.EventHandler(this.lvProjects_SelectedIndexChanged); this.lvProjects.DoubleClick += new System.EventHandler(this.lvProjects_DoubleClick); this.lvProjects.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvProjects_ColumnClick); // // colProject // this.colProject.Text = "Project"; this.colProject.Width = 160; // // colServer // this.colServer.Text = "Server"; this.colServer.Width = 100; // // colCategory // this.colCategory.Text = "Category"; this.colCategory.Width = 100; // // colActivity // this.colActivity.Text = "Activity"; this.colActivity.Width = 132; // // colDetail // this.colDetail.Text = "Detail"; this.colDetail.Width = 282; // // colLastBuildLabel // this.colLastBuildLabel.Text = "Last Build Label"; this.colLastBuildLabel.Width = 192; // // colLastBuildTime // this.colLastBuildTime.Text = "Last Build Time"; this.colLastBuildTime.Width = 112; // // colProjectStatus // this.colProjectStatus.Text = "Project Status"; // // colQName // this.colQName.Text = "Q Name"; this.colQName.Width = 100; // // colQPriority // this.colQPriority.Text = "Q Priority"; this.colQPriority.Width = 100; // // projectContextMenu // this.projectContextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuForce, this.mnuAbort, this.mnuStart, this.mnuStop, this.mnuWebPage, this.mnuCancelPending, this.mnuFixBuild, this.mnuCopyBuildLabel, this.currentStatusMenu, this.packagesMenu}); this.projectContextMenu.Popup += new System.EventHandler(this.projectContextMenu_Popup); // // mnuForce // this.mnuForce.Index = 0; this.mnuForce.Text = "&Force Build"; this.mnuForce.Click += new System.EventHandler(this.mnuForce_Click); // // mnuAbort // this.mnuAbort.Index = 1; this.mnuAbort.Text = "&Abort Build"; this.mnuAbort.Click += new System.EventHandler(this.mnuAbort_Click); // // mnuStart // this.mnuStart.Index = 2; this.mnuStart.Text = "&Start Project"; this.mnuStart.Click += new System.EventHandler(this.mnuStart_Click); // // mnuStop // this.mnuStop.Index = 3; this.mnuStop.Text = "&Stop Project"; this.mnuStop.Click += new System.EventHandler(this.mnuStop_Click); // // mnuWebPage // this.mnuWebPage.Index = 4; this.mnuWebPage.Text = "Display &Web Page"; this.mnuWebPage.Click += new System.EventHandler(this.mnuWebPage_Click); // // mnuCancelPending // this.mnuCancelPending.Index = 5; this.mnuCancelPending.Text = "&Cancel Pending"; this.mnuCancelPending.Click += new System.EventHandler(this.mnuCancelPending_Click); // // mnuFixBuild // this.mnuFixBuild.Index = 6; this.mnuFixBuild.Text = "&Volunteer to Fix Build"; this.mnuFixBuild.Click += new System.EventHandler(this.mnuFixBuild_Click); // // mnuCopyBuildLabel // this.mnuCopyBuildLabel.Index = 7; this.mnuCopyBuildLabel.Text = "Copy Build &Label"; this.mnuCopyBuildLabel.Click += new System.EventHandler(this.mnuCopyBuildLabel_Click); // // currentStatusMenu // this.currentStatusMenu.Index = 8; this.currentStatusMenu.Shortcut = System.Windows.Forms.Shortcut.F4; this.currentStatusMenu.Text = "C&urrent Status"; this.currentStatusMenu.Click += new System.EventHandler(this.currentStatusMenu_Click); // // packagesMenu // this.packagesMenu.Index = 9; this.packagesMenu.Shortcut = System.Windows.Forms.Shortcut.CtrlP; this.packagesMenu.Text = "&Packages"; this.packagesMenu.Click += new System.EventHandler(this.packagesMenu_Click); // // largeIconList // this.largeIconList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; this.largeIconList.ImageSize = new System.Drawing.Size(32, 32); this.largeIconList.TransparentColor = System.Drawing.Color.Transparent; // // iconList // this.iconList.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; this.iconList.ImageSize = new System.Drawing.Size(16, 16); this.iconList.TransparentColor = System.Drawing.Color.Transparent; // // mainMenu // this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuFile, this.mnuView, menuItem1}); // // menuFile // this.menuFile.Index = 0; this.menuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuFilePreferences, this.menuItem3, this.menuFileExit}); this.menuFile.Text = "&File"; // // mnuFilePreferences // this.mnuFilePreferences.Index = 0; this.mnuFilePreferences.Text = "&Settings..."; this.mnuFilePreferences.Click += new System.EventHandler(this.mnuFilePreferences_Click); // // menuItem3 // this.menuItem3.Index = 1; this.menuItem3.Text = "-"; // // menuFileExit // this.menuFileExit.Index = 2; this.menuFileExit.Text = "E&xit"; this.menuFileExit.Click += new System.EventHandler(this.menuFileExit_Click); // // mnuView // this.mnuView.Index = 1; this.mnuView.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuViewIcons, this.mnuViewList, this.mnuViewDetails}); this.mnuView.Text = "&View"; this.mnuView.Popup += new System.EventHandler(this.mnuView_Popup); // // mnuViewIcons // this.mnuViewIcons.Index = 0; this.mnuViewIcons.Text = "&Icons"; this.mnuViewIcons.Click += new System.EventHandler(this.mnuViewIcons_Click); // // mnuViewList // this.mnuViewList.Index = 1; this.mnuViewList.Text = "&List"; this.mnuViewList.Click += new System.EventHandler(this.mnuViewList_Click); // // mnuViewDetails // this.mnuViewDetails.Index = 2; this.mnuViewDetails.Text = "&Details"; this.mnuViewDetails.Click += new System.EventHandler(this.mnuViewDetails_Click); // // mnuTrayContextMenu // this.mnuTrayContextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuTraySettings, this.mnuShow, this.menuItem5, this.mnuTrayExit}); // // mnuTraySettings // this.mnuTraySettings.Index = 0; this.mnuTraySettings.Text = "&Settings..."; this.mnuTraySettings.Click += new System.EventHandler(this.mnuFilePreferences_Click); // // mnuShow // this.mnuShow.DefaultItem = true; this.mnuShow.Index = 1; this.mnuShow.Text = "Show Status &Window"; this.mnuShow.Click += new System.EventHandler(this.mnuShow_Click); // // menuItem5 // this.menuItem5.Index = 2; this.menuItem5.Text = "-"; // // mnuTrayExit // this.mnuTrayExit.Index = 3; this.mnuTrayExit.Text = "&Exit"; this.mnuTrayExit.Click += new System.EventHandler(this.menuFileExit_Click); // // pnlButtons // this.pnlButtons.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.pnlButtons.Controls.Add(this.btnToggleQueueView); this.pnlButtons.Controls.Add(this.btnForceBuild); this.pnlButtons.Controls.Add(this.btnStartStopProject); this.pnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom; this.pnlButtons.Location = new System.Drawing.Point(0, 226); this.pnlButtons.Name = "pnlButtons"; this.pnlButtons.Size = new System.Drawing.Size(1175, 45); this.pnlButtons.TabIndex = 1; // // btnToggleQueueView // this.btnToggleQueueView.Location = new System.Drawing.Point(105, 10); this.btnToggleQueueView.Name = "btnToggleQueueView"; this.btnToggleQueueView.Size = new System.Drawing.Size(85, 23); this.btnToggleQueueView.TabIndex = 1; this.btnToggleQueueView.Text = "Show &Queues"; this.btnToggleQueueView.Click += new System.EventHandler(this.btnToggleQueueView_Click); // // btnForceBuild // this.btnForceBuild.Location = new System.Drawing.Point(10, 10); this.btnForceBuild.Name = "btnForceBuild"; this.btnForceBuild.Size = new System.Drawing.Size(85, 23); this.btnForceBuild.TabIndex = 0; this.btnForceBuild.Text = "Force &Build"; this.btnForceBuild.Click += new System.EventHandler(this.btnForceBuild_Click); // // btnStartStopProject // this.btnStartStopProject.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnStartStopProject.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnStartStopProject.Location = new System.Drawing.Point(1076, 10); this.btnStartStopProject.Name = "btnStartStopProject"; this.btnStartStopProject.Size = new System.Drawing.Size(85, 23); this.btnStartStopProject.TabIndex = 2; this.btnStartStopProject.Text = "&Stop Project"; this.btnStartStopProject.UseVisualStyleBackColor = true; this.btnStartStopProject.Click += new System.EventHandler(this.btnStartStopProject_Click); // // splitterQueueView // this.splitterQueueView.Location = new System.Drawing.Point(200, 38); this.splitterQueueView.Name = "splitterQueueView"; this.splitterQueueView.Size = new System.Drawing.Size(3, 188); this.splitterQueueView.TabIndex = 3; this.splitterQueueView.TabStop = false; this.splitterQueueView.Visible = false; // // pnlViewQueues // this.pnlViewQueues.Controls.Add(this.queueTreeView); this.pnlViewQueues.Dock = System.Windows.Forms.DockStyle.Left; this.pnlViewQueues.Location = new System.Drawing.Point(0, 38); this.pnlViewQueues.Name = "pnlViewQueues"; this.pnlViewQueues.Size = new System.Drawing.Size(200, 188); this.pnlViewQueues.TabIndex = 4; this.pnlViewQueues.Visible = false; // // queueIconList // this.queueIconList.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; this.queueIconList.ImageSize = new System.Drawing.Size(16, 16); this.queueIconList.TransparentColor = System.Drawing.Color.Transparent; // // queueContextMenu // this.queueContextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.mnuQueueCancelPending}); // // mnuQueueCancelPending // this.mnuQueueCancelPending.Index = 0; this.mnuQueueCancelPending.Text = "&Cancel Pending"; this.mnuQueueCancelPending.Click += new System.EventHandler(this.mnuQueueCancelPending_Click); // // serverChangedPanel // this.serverChangedPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.serverChangedPanel.Controls.Add(this.closeUpdateButton); this.serverChangedPanel.Controls.Add(this.label1); this.serverChangedPanel.Controls.Add(this.updateProjectsButton); this.serverChangedPanel.Controls.Add(this.updateProjectsMessage); this.serverChangedPanel.Dock = System.Windows.Forms.DockStyle.Top; this.serverChangedPanel.Location = new System.Drawing.Point(0, 0); this.serverChangedPanel.Name = "serverChangedPanel"; this.serverChangedPanel.Size = new System.Drawing.Size(1175, 38); this.serverChangedPanel.TabIndex = 5; this.serverChangedPanel.Visible = false; // // closeUpdateButton // this.closeUpdateButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.closeUpdateButton.Location = new System.Drawing.Point(1067, 3); this.closeUpdateButton.Name = "closeUpdateButton"; this.closeUpdateButton.Size = new System.Drawing.Size(101, 28); this.closeUpdateButton.TabIndex = 3; this.closeUpdateButton.Text = "Close"; this.closeUpdateButton.UseVisualStyleBackColor = true; this.closeUpdateButton.Click += new System.EventHandler(this.closeUpdateButton_Click); // // label1 // this.label1.AutoEllipsis = true; this.label1.Image = global::ThoughtWorks.CruiseControl.CCTrayLib.Properties.Resources.ServerWarning; this.label1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.label1.Location = new System.Drawing.Point(10, 3); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(26, 28); this.label1.TabIndex = 2; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // updateProjectsButton // this.updateProjectsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.updateProjectsButton.Location = new System.Drawing.Point(960, 3); this.updateProjectsButton.Name = "updateProjectsButton"; this.updateProjectsButton.Size = new System.Drawing.Size(101, 28); this.updateProjectsButton.TabIndex = 1; this.updateProjectsButton.Text = "Update Projects"; this.updateProjectsButton.UseVisualStyleBackColor = true; this.updateProjectsButton.Click += new System.EventHandler(this.updateProjectsButton_Click); // // updateProjectsMessage // this.updateProjectsMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.updateProjectsMessage.AutoEllipsis = true; this.updateProjectsMessage.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.updateProjectsMessage.Location = new System.Drawing.Point(42, 3); this.updateProjectsMessage.Name = "updateProjectsMessage"; this.updateProjectsMessage.Size = new System.Drawing.Size(912, 28); this.updateProjectsMessage.TabIndex = 0; this.updateProjectsMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // trayIcon // this.trayIcon.ContextMenu = this.mnuTrayContextMenu; this.trayIcon.Text = "CruiseControl.NET"; this.trayIcon.Visible = true; this.trayIcon.Click += new System.EventHandler(this.trayIcon_Click); this.trayIcon.DoubleClick += new System.EventHandler(this.trayIcon_DoubleClick); // // queueTreeView // this.queueTreeView.Dock = System.Windows.Forms.DockStyle.Fill; this.queueTreeView.ImageIndex = 0; this.queueTreeView.ImageList = this.queueIconList; this.queueTreeView.Location = new System.Drawing.Point(0, 0); this.queueTreeView.Name = "queueTreeView"; this.queueTreeView.SelectedImageIndex = 0; this.queueTreeView.Size = new System.Drawing.Size(200, 188); this.queueTreeView.TabIndex = 2; this.queueTreeView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.queueTreeView_MouseUp); // // MainForm // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(1175, 271); this.Controls.Add(this.lvProjects); this.Controls.Add(this.splitterQueueView); this.Controls.Add(this.pnlViewQueues); this.Controls.Add(this.pnlButtons); this.Controls.Add(this.serverChangedPanel); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.Menu = this.mainMenu; this.MinimizeBox = false; this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "CCTray "; this.Closing += new System.ComponentModel.CancelEventHandler(this.MainForm_Closing); this.pnlButtons.ResumeLayout(false); this.pnlViewQueues.ResumeLayout(false); this.serverChangedPanel.ResumeLayout(false); this.ResumeLayout(false); }