public void AddView(CCProjectsView view)
        {
            if (m_projectViews.Count == 0)
            {
                m_current = view;
            }


            if (m_broken != null)
            {
                m_tabControl.Controls.Remove(m_broken.TabPage);
            }

            m_projectViews.Add(view);
            if (view != m_broken)
            {
                view.TabPage.TabIndex = m_tabControl.Controls.Count;
                m_tabControl.Controls.Add(view.TabPage);
            }


            if (m_broken != null)
            {
                m_broken.TabPage.TabIndex = m_tabControl.Controls.Count;
                m_tabControl.Controls.Add(m_broken.TabPage);
            }
        }
        // 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);
            }
        }
        void CCProjectsViewMgrPanel_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            CCProjectsViewMgr viewMgr = (CCProjectsViewMgr)((Panel)sender).Tag;
            CCProjectsView    view    = new CCProjectsView(viewMgr, string.Empty);

            AddView(view);
        }
        private void mnuEditName_Click(object sender, EventArgs e)
        {
            Rectangle rect = TabControl.GetTabRect(TabControl.SelectedIndex);
            Point     p    = new Point(rect.Left, rect.Top);

            CCProjectsView view = m_current;

            if (m_bUsingTextBox == false)
            {
                RenameView(p, m_current.TabPage.Text, new Control[] { view, view.TabPage }, null);
            }
        }
        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);
            }
        }
        //////////////////////////////////////////////////////////////////////////////////



        void UpdateCurrentView()
        {
            TabPage selected = this.m_tabControl.SelectedTab;

            foreach (CCProjectsView ccpv in m_projectViews)
            {
                if (ccpv.TabPage == selected)
                {
                    m_current = ccpv;
                    this.m_tabControl.SelectedTab = m_current.TabPage;
                }
            }
        }
        void mnuCreateTabFromCategory_Click(object sender, EventArgs e)
        {
            // clear existing user views



            for (int ccpvcounter = m_projectViews.Count - 1; ccpvcounter >= 0; ccpvcounter--)
            {
                CCProjectsView ccpv = m_projectViews[ccpvcounter];

                if (ccpv.IsUserView)
                {
                    ccpv.ListView.Items.Clear();
                    m_tabControl.TabPages.Remove(ccpv.TabPage);
                    ccpv.TabPage.Dispose();
                    m_projectViews.Remove(ccpv);
                }
            }



            // get all categories of the monitored projects
            System.Collections.Generic.List <string> Categories = new List <string>();

            foreach (IProjectMonitor project in this.mainForm.MainFormController.Monitors)
            {
                if (!Categories.Contains(project.Detail.Category))
                {
                    Categories.Add(project.Detail.Category);
                }
            }

            // for each category, create a tab and enter the corresponding projects to it
            foreach (string category in Categories)
            {
                CCProjectsView categoryTab = new CCProjectsView(this, category);
                categoryTab.IsUserView = true;

                AddView(categoryTab);

                // get the projects from this category
                foreach (IProjectMonitor project in this.mainForm.MainFormController.Monitors)
                {
                    if (project.Detail.Category == category)
                    {
                        ListViewItem item = mainForm.MainFormController.CopyBoundProject(project);
                        categoryTab.AddProject(item);
                    }
                }
            }
        }
        void TabControl_DragEnter(object sender, DragEventArgs e)
        {
            Console.WriteLine("tb dragenter");
            Point p = m_tabControl.PointToClient(new Point(e.X, e.Y));

            TabPage        tp = FindTabControl(p);
            CCProjectsView v  = (CCProjectsView)tp.Tag;

            if (v.IsUserView)
            {
                e.Effect = DragDropEffects.Copy;
                SelectClickedTab(p);
                UpdateCurrentView();
            }
            else
            {
                e.Effect = DragDropEffects.None;
            }
        }
        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)
            {
            }
        }
        public void RemoveOrphans()
        {
            CCProjectsView allProjects = m_projectViews[0];
            int            i;

            for (i = 1; i < m_projectViews.Count; i++)
            {
                CCProjectsView view  = m_projectViews[i];
                int            count = view.ListView.Items.Count;
                ListViewItem[] array = new ListViewItem[count];
                view.ListView.Items.CopyTo(array, 0);
                int j;
                for (j = 0; j < count; j++)
                {
                    ListViewItem item = array[j];
                    if (allProjects.Contains(item) == false)
                    {
                        view.ListView.Items.Remove(item);
                    }
                }
            }
        }
        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);
            }
        }
Пример #12
0
        //////////////////////////////////////////////////////////////////////////////////





        void UpdateCurrentView()
        {
            TabPage selected = this.m_tabControl.SelectedTab;
            foreach (CCProjectsView ccpv in m_projectViews)
            {
                if (ccpv.TabPage == selected)
                {
                    m_current = ccpv;
                    this.m_tabControl.SelectedTab = m_current.TabPage;
                }
            }
        }
Пример #13
0
        public void AddView(CCProjectsView view)
        {
            if (m_projectViews.Count == 0)
                m_current = view;


            if (m_broken != null)
                m_tabControl.Controls.Remove(m_broken.TabPage);

            m_projectViews.Add(view);
            if (view != m_broken)
            {
                view.TabPage.TabIndex = m_tabControl.Controls.Count;
                m_tabControl.Controls.Add(view.TabPage);
            }


            if (m_broken != null)
            {
                m_broken.TabPage.TabIndex = m_tabControl.Controls.Count;
                m_tabControl.Controls.Add(m_broken.TabPage);
            }

        }
Пример #14
0
 void CCProjectsViewMgrPanel_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     CCProjectsViewMgr viewMgr = (CCProjectsViewMgr)((Panel)sender).Tag;
     CCProjectsView view = new CCProjectsView(viewMgr, string.Empty);
     AddView(view);
 }
Пример #15
0
        public void LoadViewConfiguration()
        {
            string fname = GetConfigFilename();
            if (!File.Exists(fname))
                return;

            FileStream reader = new FileStream(fname, FileMode.Open, FileAccess.Read, FileShare.Read);
            System.Xml.XmlTextReader xmlReader = new XmlTextReader(reader);

            try
            {
                xmlReader.ReadStartElement("Views");
                while (xmlReader.Read())
                {
                    if (xmlReader.AttributeCount > 0)
                    {
                        string viewName = xmlReader.GetAttribute(0);

                        bool bViewAdded = false;

                        // skip "View"
                        xmlReader.Read();
                        xmlReader.Read();

                        CCProjectsView view = new CCProjectsView(this, viewName);

                        while (xmlReader.Name == "Project")
                        {

                            string ProjectName = xmlReader.GetAttribute(0);
                            xmlReader.Read();
                            xmlReader.Read();

                            string ServerName = xmlReader.GetAttribute(0);
                            xmlReader.Read();
                            xmlReader.Read();

                            CCProjectsView viewAll = m_projectViews[0];

                            ListViewItem lvi = viewAll.Contains(ProjectName);

                            if (lvi != null)
                            {
                                IProjectMonitor monitor = (IProjectMonitor)lvi.Tag;
                                ListViewItem item = mainForm.MainFormController.CopyBoundProject(monitor);

                                if (!bViewAdded)
                                {
                                    AddView(view);
                                    bViewAdded = true;
                                }

                                view.AddProject(item);

                            }
                        }
                    }
                }


                xmlReader.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Пример #16
0
        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);
        }
Пример #17
0
        void mnuCreateTabFromCategory_Click(object sender, EventArgs e)
        {
            // clear existing user views



            for (int ccpvcounter = m_projectViews.Count - 1; ccpvcounter >= 0; ccpvcounter--)
            {
                CCProjectsView ccpv = m_projectViews[ccpvcounter];
                
                if (ccpv.IsUserView)
                {
                    ccpv.ListView.Items.Clear();
                    m_tabControl.TabPages.Remove(ccpv.TabPage);
                    ccpv.TabPage.Dispose();
                    m_projectViews.Remove(ccpv);
                }
            }



            // get all categories of the monitored projects
            System.Collections.Generic.List<string> Categories = new List<string>();

            foreach (IProjectMonitor project in this.mainForm.MainFormController.Monitors)
            {
                if (!Categories.Contains(project.Detail.Category)) Categories.Add(project.Detail.Category);
            }

            // for each category, create a tab and enter the corresponding projects to it
            foreach (string category in Categories)
            {
                CCProjectsView categoryTab = new CCProjectsView(this, category);
                categoryTab.IsUserView = true;

                AddView(categoryTab);

                // get the projects from this category
                foreach (IProjectMonitor project in this.mainForm.MainFormController.Monitors)
                {
                    if (project.Detail.Category == category)
                    {
                        ListViewItem item = mainForm.MainFormController.CopyBoundProject(project);
                        categoryTab.AddProject(item);
                    }
                }
            }
        }
Пример #18
0
        // 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 void LoadViewConfiguration()
        {
            string fname = GetConfigFilename();

            if (!File.Exists(fname))
            {
                return;
            }

            FileStream reader = new FileStream(fname, FileMode.Open, FileAccess.Read, FileShare.Read);

            System.Xml.XmlTextReader xmlReader = new XmlTextReader(reader);

            try
            {
                xmlReader.ReadStartElement("Views");
                while (xmlReader.Read())
                {
                    if (xmlReader.AttributeCount > 0)
                    {
                        string viewName = xmlReader.GetAttribute(0);

                        bool bViewAdded = false;

                        // skip "View"
                        xmlReader.Read();
                        xmlReader.Read();

                        CCProjectsView view = new CCProjectsView(this, viewName);

                        while (xmlReader.Name == "Project")
                        {
                            string ProjectName = xmlReader.GetAttribute(0);
                            xmlReader.Read();
                            xmlReader.Read();

                            string ServerName = xmlReader.GetAttribute(0);
                            xmlReader.Read();
                            xmlReader.Read();

                            CCProjectsView viewAll = m_projectViews[0];

                            ListViewItem lvi = viewAll.Contains(ProjectName);

                            if (lvi != null)
                            {
                                IProjectMonitor monitor = (IProjectMonitor)lvi.Tag;
                                ListViewItem    item    = mainForm.MainFormController.CopyBoundProject(monitor);

                                if (!bViewAdded)
                                {
                                    AddView(view);
                                    bViewAdded = true;
                                }

                                view.AddProject(item);
                            }
                        }
                    }
                }


                xmlReader.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Пример #20
0
        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)
            {

            }

        }
Пример #21
0
        public CCProjectsViewMgr(MainForm form, ImageList large, ImageList small)
            : base()
        {
            mainForm = form;
            this.SuspendLayout();
            largeImageList = large;
            smallImageList = small;


            CCProjectsViewMgrPanel = new System.Windows.Forms.Panel();
            CCProjectsViewMgrPanel.Tag = this;
            Controls.Add(CCProjectsViewMgrPanel);
            CCProjectsViewMgrPanel.Location = new System.Drawing.Point(0, 0);
            CCProjectsViewMgrPanel.Name = "CCProjectsViewMgrPanel";
            CCProjectsViewMgrPanel.BackColor = Color.AliceBlue;

            CCProjectsViewMgrPanel.MouseDoubleClick += new MouseEventHandler(CCProjectsViewMgrPanel_MouseDoubleClick);

            CCProjectsViewMgrPanel.Dock = DockStyle.Fill;

            // project views are added to the tabcontrol so it needs to be created first

            m_tabControl = new TabControl();
            m_tabControl.SuspendLayout();
            m_tabControl.Name = "tabControl";
            m_tabControl.SelectedIndex = 0;
            m_tabControl.TabIndex = 0;
            m_tabControl.MouseUp += new MouseEventHandler(TabControl_MouseUp);
            m_tabControl.MouseClick += new MouseEventHandler(CCProjectsViewMgr_MouseClick);
            m_tabControl.AllowDrop = true;
            m_tabControl.DragEnter += new DragEventHandler(TabControl_DragEnter);
            m_tabControl.DragDrop += new DragEventHandler(TabControl_DragDrop);
            m_tabControl.DragOver += new DragEventHandler(TabControl_DragOver);
            m_tabControl.DragLeave += new EventHandler(m_tabControl_DragLeave);
            m_tabControl.Dock = DockStyle.Fill;
            m_tabControl.ImageList = smallImageList;
            CCProjectsViewMgrPanel.Controls.Add(m_tabControl);

            form.DragEnter += new DragEventHandler(form_DragEnter);

            // create the container of views
            m_projectViews = new List<CCProjectsView>();

            // the 'all' view always has all the projects the user has subscribed to
            m_all = new CCProjectsView(this, "All");
            m_all.IsUserView = false;

            AddView(m_all);


            // the 'broken' view is dynamically updated with any broken projects
            m_broken = new CCProjectsView(this, "Broken");
            m_broken.IsUserView = false;
            m_broken.IsReadOnly = false;
            m_broken.TabPage.ImageIndex = ProjectState.Broken.ImageIndex;
            m_broken.TabPage.TabIndex = 1;

            // we don't add it to make  iterating over 'real' views more easy
            AddView(m_broken);

            this.ResumeLayout(false);
            m_tabControl.ResumeLayout(false);

            form.dummyDockingPanel.Controls.Add(CCProjectsViewMgrPanel);

            #region // menus

            projectContextMenu = new System.Windows.Forms.ContextMenuStrip();

            mnuForce = new System.Windows.Forms.ToolStripMenuItem();
            mnuAbort = new System.Windows.Forms.ToolStripMenuItem();
            mnuStart = new System.Windows.Forms.ToolStripMenuItem();
            mnuStop = new System.Windows.Forms.ToolStripMenuItem();
            mnuWebPage = new System.Windows.Forms.ToolStripMenuItem();
            mnuCancelPending = new System.Windows.Forms.ToolStripMenuItem();
            mnuFixBuild = new System.Windows.Forms.ToolStripMenuItem();
            mnuCopyBuildLabel = new System.Windows.Forms.ToolStripMenuItem();
            mnuSendToNewTab = new System.Windows.Forms.ToolStripMenuItem();
            mnuCreateTabFromPattern = new System.Windows.Forms.ToolStripMenuItem();
            mnuCreateTabFromCategory = new System.Windows.Forms.ToolStripMenuItem();

            projectContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripMenuItem[] 
         {
            mnuForce,
            mnuAbort,
            mnuStart,
            mnuStop,
            mnuWebPage,
            mnuCancelPending,
            mnuFixBuild,
            mnuCopyBuildLabel,
            mnuSendToNewTab,
            mnuCreateTabFromPattern,
            mnuCreateTabFromCategory
         });

            mnuForce.Text = "&Force Build";
            mnuForce.Click += new System.EventHandler(mnuForce_Click);
            mnuAbort.Text = "&Abort Build";
            mnuAbort.Click += new System.EventHandler(mnuAbort_Click);
            mnuStart.Text = "&Start Project";
            mnuStart.Click += new System.EventHandler(mnuStart_Click);
            mnuStop.Text = "&Stop Project";
            mnuStop.Click += new System.EventHandler(mnuStop_Click);
            mnuWebPage.Text = "Display &Web Page";
            mnuWebPage.Click += new System.EventHandler(mnuWebPage_Click);
            mnuCancelPending.Text = "&Cancel Pending";
            mnuCancelPending.Click += new System.EventHandler(mnuCancelPending_Click);
            mnuFixBuild.Text = "&Volunteer to Fix Build";
            mnuFixBuild.Click += new System.EventHandler(mnuFixBuild_Click);
            mnuCopyBuildLabel.Text = "Copy Build &Label";
            mnuCopyBuildLabel.Click += new System.EventHandler(mnuCopyBuildLabel_Click);

            mnuSendToNewTab.Text = "Send to New &Tab";
            mnuSendToNewTab.Click += new EventHandler(mnuSendToNewTab_Click);

            mnuCreateTabFromPattern.Text = "New Tab from &Pattern";
            mnuCreateTabFromPattern.Click += new EventHandler(mnuCreateTabFromPattern_Click);

            mnuCreateTabFromCategory.Text = "Create tabs from category";
            mnuCreateTabFromCategory.Click += new EventHandler(mnuCreateTabFromCategory_Click);

            tabContextMenu = new System.Windows.Forms.ContextMenuStrip();
            mnuEditName = new System.Windows.Forms.ToolStripMenuItem();
            mnuDeleteTab = new System.Windows.Forms.ToolStripMenuItem();
            tabContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripMenuItem[] {
                mnuEditName,
                mnuDeleteTab, 
            });

            mnuEditName.Text = "&Rename Tab";
            mnuEditName.Click += new System.EventHandler(mnuEditName_Click);
            mnuDeleteTab.Text = "&Delete Tab";
            mnuDeleteTab.Click += new System.EventHandler(mnuDeleteTab_Click);

            #endregion

            mainForm.MainFormController.BindToViewMgr(this);

            // restore users tabs
            LoadViewConfiguration();

            // colour in the icons on each tab
            UpdateAllTabPageIcons(null);


            // set up the general edit box
            // this needs a tidy up
            m_tb = new TextBox();
            m_tb.PreviewKeyDown += new PreviewKeyDownEventHandler(tb_PreviewKeyDown);
            m_tb.LostFocus += new EventHandler(tb_LostFocus);

            int timerPeriod = mainForm.Configuration.PollPeriodSeconds * 1000;
            m_bTimerRunning = false;
            m_viewUpdate = new System.Threading.Timer(new System.Threading.TimerCallback(UpdateAllTabPageIcons), this, 0, timerPeriod);

            this.Show();
        }
        public CCProjectsViewMgr(MainForm form, ImageList large, ImageList small)
            : base()
        {
            mainForm = form;
            this.SuspendLayout();
            largeImageList = large;
            smallImageList = small;


            CCProjectsViewMgrPanel     = new System.Windows.Forms.Panel();
            CCProjectsViewMgrPanel.Tag = this;
            Controls.Add(CCProjectsViewMgrPanel);
            CCProjectsViewMgrPanel.Location  = new System.Drawing.Point(0, 0);
            CCProjectsViewMgrPanel.Name      = "CCProjectsViewMgrPanel";
            CCProjectsViewMgrPanel.BackColor = Color.AliceBlue;

            CCProjectsViewMgrPanel.MouseDoubleClick += new MouseEventHandler(CCProjectsViewMgrPanel_MouseDoubleClick);

            CCProjectsViewMgrPanel.Dock = DockStyle.Fill;

            // project views are added to the tabcontrol so it needs to be created first

            m_tabControl = new TabControl();
            m_tabControl.SuspendLayout();
            m_tabControl.Name          = "tabControl";
            m_tabControl.SelectedIndex = 0;
            m_tabControl.TabIndex      = 0;
            m_tabControl.MouseUp      += new MouseEventHandler(TabControl_MouseUp);
            m_tabControl.MouseClick   += new MouseEventHandler(CCProjectsViewMgr_MouseClick);
            m_tabControl.AllowDrop     = true;
            m_tabControl.DragEnter    += new DragEventHandler(TabControl_DragEnter);
            m_tabControl.DragDrop     += new DragEventHandler(TabControl_DragDrop);
            m_tabControl.DragOver     += new DragEventHandler(TabControl_DragOver);
            m_tabControl.DragLeave    += new EventHandler(m_tabControl_DragLeave);
            m_tabControl.Dock          = DockStyle.Fill;
            m_tabControl.ImageList     = smallImageList;
            CCProjectsViewMgrPanel.Controls.Add(m_tabControl);

            form.DragEnter += new DragEventHandler(form_DragEnter);

            // create the container of views
            m_projectViews = new List <CCProjectsView>();

            // the 'all' view always has all the projects the user has subscribed to
            m_all            = new CCProjectsView(this, "All");
            m_all.IsUserView = false;

            AddView(m_all);


            // the 'broken' view is dynamically updated with any broken projects
            m_broken                    = new CCProjectsView(this, "Broken");
            m_broken.IsUserView         = false;
            m_broken.IsReadOnly         = false;
            m_broken.TabPage.ImageIndex = ProjectState.Broken.ImageIndex;
            m_broken.TabPage.TabIndex   = 1;

            // we don't add it to make  iterating over 'real' views more easy
            AddView(m_broken);

            this.ResumeLayout(false);
            m_tabControl.ResumeLayout(false);

            form.dummyDockingPanel.Controls.Add(CCProjectsViewMgrPanel);

            #region // menus

            projectContextMenu = new System.Windows.Forms.ContextMenuStrip();

            mnuForce                 = new System.Windows.Forms.ToolStripMenuItem();
            mnuAbort                 = new System.Windows.Forms.ToolStripMenuItem();
            mnuStart                 = new System.Windows.Forms.ToolStripMenuItem();
            mnuStop                  = new System.Windows.Forms.ToolStripMenuItem();
            mnuWebPage               = new System.Windows.Forms.ToolStripMenuItem();
            mnuCancelPending         = new System.Windows.Forms.ToolStripMenuItem();
            mnuFixBuild              = new System.Windows.Forms.ToolStripMenuItem();
            mnuCopyBuildLabel        = new System.Windows.Forms.ToolStripMenuItem();
            mnuSendToNewTab          = new System.Windows.Forms.ToolStripMenuItem();
            mnuCreateTabFromPattern  = new System.Windows.Forms.ToolStripMenuItem();
            mnuCreateTabFromCategory = new System.Windows.Forms.ToolStripMenuItem();

            projectContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripMenuItem[]
            {
                mnuForce,
                mnuAbort,
                mnuStart,
                mnuStop,
                mnuWebPage,
                mnuCancelPending,
                mnuFixBuild,
                mnuCopyBuildLabel,
                mnuSendToNewTab,
                mnuCreateTabFromPattern,
                mnuCreateTabFromCategory
            });

            mnuForce.Text            = "&Force Build";
            mnuForce.Click          += new System.EventHandler(mnuForce_Click);
            mnuAbort.Text            = "&Abort Build";
            mnuAbort.Click          += new System.EventHandler(mnuAbort_Click);
            mnuStart.Text            = "&Start Project";
            mnuStart.Click          += new System.EventHandler(mnuStart_Click);
            mnuStop.Text             = "&Stop Project";
            mnuStop.Click           += new System.EventHandler(mnuStop_Click);
            mnuWebPage.Text          = "Display &Web Page";
            mnuWebPage.Click        += new System.EventHandler(mnuWebPage_Click);
            mnuCancelPending.Text    = "&Cancel Pending";
            mnuCancelPending.Click  += new System.EventHandler(mnuCancelPending_Click);
            mnuFixBuild.Text         = "&Volunteer to Fix Build";
            mnuFixBuild.Click       += new System.EventHandler(mnuFixBuild_Click);
            mnuCopyBuildLabel.Text   = "Copy Build &Label";
            mnuCopyBuildLabel.Click += new System.EventHandler(mnuCopyBuildLabel_Click);

            mnuSendToNewTab.Text   = "Send to New &Tab";
            mnuSendToNewTab.Click += new EventHandler(mnuSendToNewTab_Click);

            mnuCreateTabFromPattern.Text   = "New Tab from &Pattern";
            mnuCreateTabFromPattern.Click += new EventHandler(mnuCreateTabFromPattern_Click);

            mnuCreateTabFromCategory.Text   = "Create tabs from category";
            mnuCreateTabFromCategory.Click += new EventHandler(mnuCreateTabFromCategory_Click);

            tabContextMenu = new System.Windows.Forms.ContextMenuStrip();
            mnuEditName    = new System.Windows.Forms.ToolStripMenuItem();
            mnuDeleteTab   = new System.Windows.Forms.ToolStripMenuItem();
            tabContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripMenuItem[] {
                mnuEditName,
                mnuDeleteTab,
            });

            mnuEditName.Text    = "&Rename Tab";
            mnuEditName.Click  += new System.EventHandler(mnuEditName_Click);
            mnuDeleteTab.Text   = "&Delete Tab";
            mnuDeleteTab.Click += new System.EventHandler(mnuDeleteTab_Click);

            #endregion

            mainForm.MainFormController.BindToViewMgr(this);

            // restore users tabs
            LoadViewConfiguration();

            // colour in the icons on each tab
            UpdateAllTabPageIcons(null);


            // set up the general edit box
            // this needs a tidy up
            m_tb = new TextBox();
            m_tb.PreviewKeyDown += new PreviewKeyDownEventHandler(tb_PreviewKeyDown);
            m_tb.LostFocus      += new EventHandler(tb_LostFocus);

            int timerPeriod = mainForm.Configuration.PollPeriodSeconds * 1000;
            m_bTimerRunning = false;
            m_viewUpdate    = new System.Threading.Timer(new System.Threading.TimerCallback(UpdateAllTabPageIcons), this, 0, timerPeriod);

            this.Show();
        }