public ObjectRefsGrid()
        {
            BorderStyle   = System.Windows.Forms.BorderStyle.FixedSingle;
            Dock          = System.Windows.Forms.DockStyle.Fill;
            GridLineStyle = GridLineStyle.HorizontalAndVertical;
            Font          = PluginBase.Settings.DefaultFont;

            UseColumns = true;

            Columns.Add(new TreeColumn(PluginCore.Localization.TextHelper.GetString("Columns.Method"), 350));
            Columns.Add(new TreeColumn(PluginCore.Localization.TextHelper.GetString("Columns.File"), 200));
            Columns.Add(new TreeColumn(PluginCore.Localization.TextHelper.GetString("Columns.Line"), 50));

            methodTB = new NodeTextBox();
            methodTB.DataPropertyName = "Method";
            methodTB.ParentColumn     = Columns[0];
            methodTB.Font             = PluginBase.Settings.DefaultFont;
            fileTB = new NodeTextBox();
            fileTB.DataPropertyName = "File";
            fileTB.ParentColumn     = Columns[1];
            fileTB.Font             = PluginBase.Settings.DefaultFont;
            lineTB = new NodeTextBox();
            lineTB.DataPropertyName = "Line";
            lineTB.ParentColumn     = Columns[2];
            lineTB.Font             = PluginBase.Settings.DefaultFont;

            NodeControls.Add(methodTB);
            NodeControls.Add(fileTB);
            NodeControls.Add(lineTB);
        }
Beispiel #2
0
 private void OnNodePropertiesClicked(object sender, EventArgs e)
 {
     _multipleNodesProperties = new MultipleNodesProperties(NodeControls.Select(q => q.ViewModelNode.NodeProperties).ToList());
     SelectorControl.NodePropertiesDialog.DataContext = _multipleNodesProperties;
     SelectorControl.NodePropertiesDialog.Closed     += NodesPropertiesDialogOnClosed;
     SelectorControl.NodePropertiesDialog.Show();
 }
Beispiel #3
0
        private SelectedNodesCollection GetSelectedNodesCollection()
        {
            var viewModelNodes = NodeControls.Select(q => q.ViewModelNode);
            var relationships  = SelectorControl.GetRelationships();

            return(new SelectedNodesCollection(viewModelNodes, relationships));
        }
Beispiel #4
0
 private void MultiNodesContextMenuOnChangeNodeTypeClicked(object sender, ChangeNodeTypeEventArgs e)
 {
     if (NodeControls.Any())
     {
         if (NodeControls.Any(q => q.ViewModelNode.IsMapNode))
         {
             SuperMessageBoxService.ShowWarning("Change Node Type",
                                                "You are changing a map node, you might lose any content within the map. Are you sure you wish to continue? \r\n\r\n" +
                                                "Press YES to change node type anyway\r\n" +
                                                "Press NO to Cancel",
                                                "Yes",
                                                "No",
                                                () =>
             {
                 foreach (var selectableNode in NodeControls)
                 {
                     IoC.GetInstance <ISuperGraphNodeFactory>().UpdateNode(selectableNode.ViewModelNode, e.ChangedTo);
                 }
             });
         }
         else
         {
             foreach (var selectableNode in NodeControls)
             {
                 IoC.GetInstance <ISuperGraphNodeFactory>().UpdateNode(selectableNode.ViewModelNode, e.ChangedTo);
             }
         }
     }
 }
Beispiel #5
0
 //Remove node from selection
 public void RemoveNode(ISelectableNode nodeControl)
 {
     if (HasNode(nodeControl))
     {
         NodeControls.Remove(nodeControl);
         nodeControl.DeSelect();
     }
 }
Beispiel #6
0
 //Add node to selection
 public void AddNode(ISelectableNode nodeControl, bool isShowDetails = true)
 {
     if (!HasNode(nodeControl))
     {
         NodeControls.Add(nodeControl);
         nodeControl.Select(isShowDetails);
     }
 }
Beispiel #7
0
        public TestTreeView()
        {
            nodeCheckBox = new NodeCheckBox();
            NodeControls.Add(nodeCheckBox);

            NodeControls.Add(new TestKindIcon());

            NodeControls.Add(new TestStatusNodeIcon());

            nodeTextBox = new TestNodeTextBox();
            NodeControls.Add(nodeTextBox);
        }
Beispiel #8
0
            public _Control(PopupList p)
            {
                _p = p;

                this.BorderStyle = BorderStyle.FixedSingle;
                this.SetStyle(ControlStyles.Selectable                 //prevent focusing control and activating window on click
                              , false);

                this.ShowNodeToolTips = true;
                this.FullRowSelect    = true;
                this.ShowPlusMinus    = false; this.ShowLines = false;
                this.GridLineStyle    = GridLineStyle.Horizontal;
                //this.AutoRowHeight=false;

                _ccCheck                      = new NodeCheckBox();
                _ccCheck.LeftMargin           = 4;
                _ccCheck.IsVisibleValueNeeded = o => o.Tag is IPopupListItem e && e.CheckType != default;
                _ccCheck.ValueNeeded          = o => o.Tag is IPopupListItem e && e.Checked ? CheckState.Checked : default;
                NodeControls.Add(_ccCheck);

                _ccIcon                      = new NodeIcon();
                _ccIcon.LeftMargin           = 4;
                _ccIcon.ScaleMode            = ImageScaleMode.ScaleUp;
                _ccIcon.DpiStretch           = true;
                _ccIcon.IsVisibleValueNeeded = o => o.Tag is IPopupListItem e && e.Icon != null;
                _ccIcon.ValueNeeded          = o => o.Tag is IPopupListItem e ? e.Icon : null;
                NodeControls.Add(_ccIcon);

                _ccText = new NodeTextBox();
                //_ccText.LeftMargin = 0; //default 1
                _ccText.Trimming          = StringTrimming.EllipsisCharacter;
                _ccText.ValueNeeded       = node => node.Tag;
                _ccText.FontNeeded        = node => (node.Tag is IPopupListItem x && x.BoldFont) ? _p._w.FontBold : _p._w.Font;
                _ccText.DrawText         += _ccText_DrawText;
                _ccText.NeedDrawTextEvent = node => node.Tag is IPopupListItem x && (x.TextColor != default || (x.Disabled && x.BackColor == default));
                NodeControls.Add(_ccText);

#if false //test column header and multiple columns
                UseColumns = true;
                var _columnName = new TreeColumn("Name", 50);
                this.Columns.Add(_columnName);
                _ccText.ParentColumn = _columnName;

                //var _cc2 = new NodeTextBox();
                //_cc2.ValueNeeded = node => "2";
                //NodeControls.Add(_cc2);
                //var _col2 = new TreeColumn("Two", 50);
                //this.Columns.Add(_col2);
                //_cc2.ParentColumn = _col2;
#endif
            }
Beispiel #9
0
        //Clear selection
        public void Clear()
        {
            foreach (var nodeControl in NodeControls)
            {
                nodeControl.DeSelect();
            }
            NodeControls.Clear();

            foreach (var arrowControl in ArrowControls)
            {
                arrowControl.DeSelect();
            }
            ArrowControls.Clear();
        }
Beispiel #10
0
        private void OnCloneClicked(object sender, EventArgs eventArgs)
        {
            var nodes         = NodeControls.Select(q => q.ViewModelNode).ToList();
            var relationships = new List <Relationship>();

            foreach (var relationship in SelectorControl.GetRelationships())
            {
                if (nodes.Any(n => n.Id == relationship.From) || nodes.Any(n => n.Id == relationship.To))
                {
                    relationships.Add(relationship);
                }
            }
            Clear();
            IoC.GetInstance <ISuperGraphNodeFactory>().CloneNodes(nodes, relationships);
        }
Beispiel #11
0
        public PluginTreeView()
        {
            var nodeCheckBox = new NodeCheckBox();

            NodeControls.Add(nodeCheckBox);

            var nodeIcon = new NodeIcon
            {
                DataPropertyName = "Image",
            };

            NodeControls.Add(nodeIcon);

            NodeControls.Add(new NodeTextBox());
        }
Beispiel #12
0
        public BambooTestResultTree()
        {
            Dock          = DockStyle.Fill;
            SelectionMode = TreeSelectionMode.Single;
            FullRowSelect = true;
            GridLineStyle = GridLineStyle.None;
            UseColumns    = true;

            colIconAndName.Header = "Test Method";
            colResult.Header      = "Result";

            int i = 0;

            controlIcon.ParentColumn     = colIconAndName;
            controlIcon.DataPropertyName = "Icon";
            controlIcon.LeftMargin       = i++;

            controlName.ParentColumn               = colIconAndName;
            controlName.DataPropertyName           = "Name";
            controlName.Trimming                   = StringTrimming.EllipsisCharacter;
            controlName.UseCompatibleTextRendering = true;
            controlName.LeftMargin                 = i++;

            controlResult = new ColoredNodeTextBox(this)
            {
                ParentColumn               = colResult,
                DataPropertyName           = "Result",
                Trimming                   = StringTrimming.EllipsisCharacter,
                UseCompatibleTextRendering = true,
                LeftMargin                 = i++,
                TextAlign                  = HorizontalAlignment.Right
            };

            Columns.Add(colIconAndName);
            Columns.Add(colResult);

            NodeControls.Add(controlIcon);
            NodeControls.Add(controlName);
            NodeControls.Add(controlResult);

            colResult.TextAlign = HorizontalAlignment.Right;

            Resize += bambooBuildTreeResize;

            resizeColumns();
        }
Beispiel #13
0
        public ObjectRefsGrid()
        {
            BorderStyle   = System.Windows.Forms.BorderStyle.None;
            Dock          = System.Windows.Forms.DockStyle.Fill;
            GridLineStyle = GridLineStyle.HorizontalAndVertical;
            Font          = PluginBase.Settings.DefaultFont;

            UseColumns = true;

            Columns.Add(new TreeColumn(PluginCore.Localization.TextHelper.GetString("Columns.Method"), 350));
            Columns.Add(new TreeColumn(PluginCore.Localization.TextHelper.GetString("Columns.File"), 200));
            Columns.Add(new TreeColumn(PluginCore.Localization.TextHelper.GetString("Columns.Line"), 50));

            foreach (TreeColumn column in this.Columns)
            {
                column.Width = ScaleHelper.Scale(column.Width);
            }

            methodTB = new NodeTextBox();
            methodTB.DataPropertyName = "Method";
            methodTB.ParentColumn     = Columns[0];
            methodTB.Font             = PluginBase.Settings.DefaultFont;
            fileTB = new NodeTextBox();
            fileTB.DataPropertyName = "File";
            fileTB.ParentColumn     = Columns[1];
            fileTB.Font             = PluginBase.Settings.DefaultFont;
            lineTB = new NodeTextBox();
            lineTB.DataPropertyName = "Line";
            lineTB.ParentColumn     = Columns[2];
            lineTB.Font             = PluginBase.Settings.DefaultFont;

            NodeControls.Add(methodTB);
            NodeControls.Add(fileTB);
            NodeControls.Add(lineTB);

            this.CustomDrawHeaders       = PluginBase.MainForm.GetThemeColor("ColumnHeader.BorderColor") != Color.Empty;
            this.ColumnHeaderBackColor   = PluginBase.MainForm.GetThemeColor("ColumnHeader.BackColor", SystemColors.Control);
            this.ColumnHeaderTextColor   = PluginBase.MainForm.GetThemeColor("ColumnHeader.TextColor", SystemColors.ControlText);
            this.ColumnHeaderBorderColor = PluginBase.MainForm.GetThemeColor("ColumnHeader.BorderColor", SystemColors.ActiveBorder);
            this.LineColor         = PluginBase.MainForm.GetThemeColor("DataTreeControl.LineColor", SystemColors.ActiveBorder);
            this.LineColor2        = PluginBase.MainForm.GetThemeColor("DataTreeControl.LineColor", SystemColors.ActiveBorder);
            this.DragDropMarkColor = PluginBase.MainForm.GetThemeColor("DataTreeControl.ForeColor", SystemColors.WindowText);
            this.ForeColor         = PluginBase.MainForm.GetThemeColor("TreeViewAdv.ForeColor", SystemColors.ControlText);
            this.BackColor         = PluginBase.MainForm.GetThemeColor("TreeViewAdv.BackColor", SystemColors.Control);
        }
Beispiel #14
0
        public ProcessesTreeView()
        {
            _skipSelectionChangedEvent = false;
            InitializeColumnHeaders();
            InitializeColumnControls();

            Columns.Add(_tcProcessIcon);
            Columns.Add(_tcProcessPid);

            NodeControls.Add(_ncProcessIcon);
            NodeControls.Add(_ncProcessName);
            NodeControls.Add(_ncProcessCategory);
            NodeControls.Add(_ncProcessCategoryTitleSize);
            NodeControls.Add(_ncProcessPid);

            AutoRowHeight = true;
            FullRowSelect = true;
        }
Beispiel #15
0
        public ProjectTreeView()
        {
            var nodeIcon = new NodeIcon {
                DataPropertyName = "Image", LeftMargin = 1, ParentColumn = null
            };

            NodeControls.Add(nodeIcon);

            var nodeTextBox = new NodeTextBox
            {
                DataPropertyName         = "Text",
                IncrementalSearchEnabled = true,
                EditEnabled  = false,
                LeftMargin   = 3,
                ParentColumn = null
            };

            NodeControls.Add(nodeTextBox);
        }
Beispiel #16
0
 private void DeleteAllNodes()
 {
     if (NodeControls.Any(q => q.ViewModelNode.IsMapNode))
     {
         SuperMessageBoxService.ShowWarning("Delete Node(s)",
                                            "You have selected map node(s) to be deleted. All content within the map node(s) will be deleted." +
                                            "Press YES to delete",
                                            "Yes",
                                            "Cancel",
                                            () =>
         {
             var deleteNodeCollection = GetSelectedNodesCollection();
             IoC.GetInstance <ISuperGraphRelationshipFactory>().DeleteNodes(deleteNodeCollection.Nodes.ToList(), SelectorControl.Context, true);
         });
     }
     else
     {
         var deleteNodeCollection = GetSelectedNodesCollection();
         IoC.GetInstance <ISuperGraphRelationshipFactory>().DeleteNodes(deleteNodeCollection.Nodes.ToList(), SelectorControl.Context, true);
     }
 }
        internal void SortColumn(TreeColumn column)
        {
            if (column == null)
            {
                return;
            }

            var nodes = ((TreeModel)Model).Nodes.ToList();

            nodes.Sort(delegate(Node node1, Node node2)
            {
                NodeControl nodeControl = NodeControls.FirstOrDefault(control => control.ParentColumn == column);
                if (nodeControl == null)
                {
                    return(0);
                }

                string propName = nodeControl.GetType().GetProperty("DataPropertyName").GetValue(nodeControl, null).ToString();

                object obj1   = node1.GetType().GetProperty(propName).GetValue(node1, null);
                object obj2   = node2.GetType().GetProperty(propName).GetValue(node2, null);
                string value1 = (obj1 == null) ? string.Empty : obj1.ToString();
                string value2 = (obj2 == null) ? string.Empty : obj2.ToString();

                return(column.SortOrder == SortOrder.Ascending ? value1.CompareTo(value2) : value2.CompareTo(value1));
            });

            ((TreeModel)Model).Nodes.Clear();
            foreach (var node in nodes)
            {
                ((TreeModel)Model).Nodes.Add(node);
            }

            Invalidate();
            Update();
            Refresh();
        }
Beispiel #18
0
 public void DeleteNodes(UserControl sender = null)
 {
     if (HasInvisibleNodesSelected())
     {
         SuperMessageBoxService.ShowWarning("Delete Node(s)",
                                            "Some hidden nodes have been selected, are you sure you wish to delete them? \r\n\r\n" +
                                            "Press YES to delete them\r\n" +
                                            "Press NO to show all hidden nodes",
                                            "Yes",
                                            "No",
                                            "Cancel",
                                            DeleteAllNodes,
                                            () =>
         {
             foreach (var nodeControl in NodeControls)
             {
                 if (nodeControl.CollapseState == CollapseState.Collapsed ||
                     nodeControl.CollapseState == CollapseState.SemiCollapsed)
                 {
                     var control = nodeControl as NodeControl;
                     if (control != null && control.GetAllChildNodeControls().Any(q => q.ViewModelNode.IsSelected))
                     {
                         control.CollapseControl.ExpandNodes(new ChildrenControlCollection(control));
                     }
                 }
             }
             if (sender != null)
             {
                 sender.Focus();
             }
         },
                                            () =>
         {
             if (sender != null)
             {
                 sender.Focus();
             }
         });
     }
     else
     {
         if (NodeControls.Any(q => q.CollapseState == CollapseState.Collapsed || q.CollapseState == CollapseState.SemiCollapsed))
         {
             SuperMessageBoxService.ShowWarning("Delete Node(s)",
                                                "The selected node(s) have hidden related node(s), are you sure you wish to delete your selection? \r\n\r\n" +
                                                "Press YES to delete the selected node(s) then show the hidden node(s)\r\n" +
                                                "Press NO to just show the hidden node(s)",
                                                "Yes",
                                                "No",
                                                "Cancel",
                                                () =>
             {
                 DeleteAllNodes();
                 SelectorControl.RecheckIncorrectVisibility();
                 SelectorControl.ReScanForCollapseStates();
             },
                                                () =>
             {
                 foreach (var nodeControl in NodeControls)
                 {
                     if (nodeControl.CollapseState == CollapseState.Collapsed ||
                         nodeControl.CollapseState == CollapseState.SemiCollapsed)
                     {
                         var control = nodeControl as NodeControl;
                         if (control != null)
                         {
                             control.CollapseControl.ExpandNodes(new ChildrenControlCollection(control, false, true));
                         }
                     }
                 }
                 if (sender != null)
                 {
                     sender.Focus();
                 }
             },
                                                () =>
             {
                 if (sender != null)
                 {
                     sender.Focus();
                 }
             });
         }
         else
         {
             DeleteAllNodes();
         }
     }
 }
Beispiel #19
0
 public bool HasInvisibleNodesSelected()
 {
     return(NodeControls.Any(q => q.IsCollapsed));
 }
 public bool ContainsNodeControl(NodeControl nodeControl)
 {
     return(NodeControls.Contains(nodeControl));
 }
Beispiel #21
0
 //Check if node has been selected
 public bool HasNode(ISelectableNode nodeControl)
 {
     return(NodeControls.Contains(nodeControl));
 }
        public JiraIssueTree(SplitContainer splitter, StatusLabel status, JiraIssueListModel model, int itemHeight, Font font)
        {
            parent      = splitter.Panel2;
            this.status = status;
            this.model  = model;

            Dock             = DockStyle.Fill;
            SelectionMode    = TreeSelectionMode.Single;
            FullRowSelect    = true;
            GridLineStyle    = GridLineStyle.None;
            UseColumns       = true;
            RowHeight        = itemHeight;
            Font             = font;
            ShowNodeToolTips = true;

            colName.Header     = "Summary";
            colStatus.Header   = "Status";
            colPriority.Header = "P";
            colUpdated.Header  = "Updated";

            int i = 0;

            controlIcon.ParentColumn     = colName;
            controlIcon.DataPropertyName = "Icon";
            controlIcon.LeftMargin       = i++;
            controlIcon.ToolTipProvider  = toolTipProvider;

            controlName.ParentColumn               = colName;
            controlName.DataPropertyName           = "Name";
            controlName.Trimming                   = StringTrimming.EllipsisCharacter;
            controlName.UseCompatibleTextRendering = true;
            controlName.ToolTipProvider            = toolTipProvider;
            controlName.LeftMargin                 = i++;

            controlPriorityIcon.ParentColumn     = colPriority;
            controlPriorityIcon.DataPropertyName = "PriorityIcon";
            controlPriorityIcon.ToolTipProvider  = toolTipProvider;
            controlPriorityIcon.LeftMargin       = i++;

            controlStatusIcon.ParentColumn     = colStatus;
            controlStatusIcon.DataPropertyName = "StatusIcon";
            controlStatusIcon.ToolTipProvider  = toolTipProvider;
            controlStatusIcon.LeftMargin       = i++;

            controlStatusText.ParentColumn               = colStatus;
            controlStatusText.DataPropertyName           = "StatusText";
            controlStatusText.Trimming                   = StringTrimming.EllipsisCharacter;
            controlStatusText.UseCompatibleTextRendering = true;
            controlStatusText.ToolTipProvider            = toolTipProvider;
            controlStatusText.LeftMargin                 = i++;

            controlUpdated.ParentColumn               = colUpdated;
            controlUpdated.DataPropertyName           = "Updated";
            controlUpdated.Trimming                   = StringTrimming.EllipsisCharacter;
            controlUpdated.UseCompatibleTextRendering = true;
            controlUpdated.TextAlign                  = HorizontalAlignment.Right;
            controlUpdated.ToolTipProvider            = toolTipProvider;
            controlUpdated.LeftMargin                 = i;

            Columns.Add(colName);
            Columns.Add(colPriority);
            Columns.Add(colStatus);
            Columns.Add(colUpdated);

            NodeControls.Add(controlIcon);
            NodeControls.Add(controlName);
            NodeControls.Add(controlPriorityIcon);
            NodeControls.Add(controlStatusIcon);
            NodeControls.Add(controlStatusText);
            NodeControls.Add(controlUpdated);

            loadColumnWidths();

            parent.SizeChanged     += parentSizeChanged;
            splitter.SizeChanged   += parentSizeChanged;
            splitter.SplitterMoved += parentSizeChanged;

            colPriority.TextAlign      = HorizontalAlignment.Left;
            colPriority.Width          = PRIORITY_WIDTH;
            colPriority.MinColumnWidth = PRIORITY_WIDTH;
            colPriority.MaxColumnWidth = PRIORITY_WIDTH;

            colStatus.Width          = statusWidth;
            colStatus.MinColumnWidth = STATUS_MIN;

            colUpdated.Width          = updatedWidth;
            colUpdated.MinColumnWidth = UPDATED_MIN;

            colName.TextAlign       = HorizontalAlignment.Left;
            colPriority.TooltipText = "Priority";
            colStatus.TextAlign     = HorizontalAlignment.Left;
            colPriority.TextAlign   = HorizontalAlignment.Left;
            colUpdated.TextAlign    = HorizontalAlignment.Right;

            setSummaryColumnWidth();

            ItemDrag += jiraIssueTreeItemDrag;

            Expanded  += jiraIssueTreeExpanded;
            Collapsed += jiraIssueTreeCollapsed;

            colUpdated.WidthChanged += columnWidthChanged;
            colStatus.WidthChanged  += columnWidthChanged;
        }
        public BambooBuildTree(SplitContainer splitter)
        {
            parent = splitter.Panel1;

            Dock          = DockStyle.Fill;
            SelectionMode = TreeSelectionMode.Single;
            FullRowSelect = true;
            GridLineStyle = GridLineStyle.None;
            UseColumns    = true;

            colStatusAndKey.Header = "Key and Status";
            colTests.Header        = "Tests";
            colReason.Header       = "Reason";
            colCompleted.Header    = "Completed";
            colDuration.Header     = "Duration";
            colServer.Header       = "Server";

            int i = 0;

            controlIcon.ParentColumn     = colStatusAndKey;
            controlIcon.DataPropertyName = "Icon";
            controlIcon.LeftMargin       = i++;

            inProgressIcon = new NodeBuildInProgressIcon(this)
            {
                ParentColumn     = colStatusAndKey,
                DataPropertyName = "IsInProgress",
                LeftMargin       = i++
            };

            controlBuildKey.ParentColumn               = colStatusAndKey;
            controlBuildKey.DataPropertyName           = "Key";
            controlBuildKey.Trimming                   = StringTrimming.EllipsisCharacter;
            controlBuildKey.UseCompatibleTextRendering = true;
            controlBuildKey.LeftMargin                 = i++;

            controlTests.ParentColumn               = colTests;
            controlTests.DataPropertyName           = "Tests";
            controlTests.Trimming                   = StringTrimming.EllipsisCharacter;
            controlTests.UseCompatibleTextRendering = true;
            controlTests.LeftMargin                 = i++;

            controlReason.ParentColumn               = colReason;
            controlReason.DataPropertyName           = "Reason";
            controlReason.Trimming                   = StringTrimming.EllipsisCharacter;
            controlReason.UseCompatibleTextRendering = true;
            controlReason.LeftMargin                 = i++;

            controlCompleted.ParentColumn               = colCompleted;
            controlCompleted.DataPropertyName           = "Completed";
            controlCompleted.Trimming                   = StringTrimming.EllipsisCharacter;
            controlCompleted.UseCompatibleTextRendering = true;
            controlCompleted.LeftMargin                 = i++;

            controlDuration.ParentColumn               = colDuration;
            controlDuration.DataPropertyName           = "Duration";
            controlDuration.Trimming                   = StringTrimming.EllipsisCharacter;
            controlDuration.UseCompatibleTextRendering = true;
            controlDuration.LeftMargin                 = i++;

            controlServer.ParentColumn               = colServer;
            controlServer.DataPropertyName           = "Server";
            controlServer.Trimming                   = StringTrimming.EllipsisCharacter;
            controlServer.UseCompatibleTextRendering = true;
            controlServer.TextAlign                  = HorizontalAlignment.Right;
            controlServer.LeftMargin                 = i;

            Columns.Add(colStatusAndKey);
            Columns.Add(colTests);
            Columns.Add(colReason);
            Columns.Add(colCompleted);
            Columns.Add(colDuration);
            Columns.Add(colServer);

            NodeControls.Add(controlIcon);
            NodeControls.Add(inProgressIcon);
            NodeControls.Add(controlBuildKey);
            NodeControls.Add(controlTests);
            NodeControls.Add(controlReason);
            NodeControls.Add(controlCompleted);
            NodeControls.Add(controlDuration);
            NodeControls.Add(controlServer);

            colServer.TextAlign = HorizontalAlignment.Right;

            parent.Resize          += bambooBuildTreeResize;
            splitter.Resize        += bambooBuildTreeResize;
            splitter.SplitterMoved += bambooBuildTreeResize;


            colStatusAndKey.MinColumnWidth = MIN_COLUMN_WIDTH;
            colTests.MinColumnWidth        = MIN_COLUMN_WIDTH;
            colCompleted.MinColumnWidth    = MIN_COLUMN_WIDTH;
            colDuration.MinColumnWidth     = MIN_COLUMN_WIDTH;
            colServer.MinColumnWidth       = MIN_COLUMN_WIDTH;

            loadColumnWidths();
            resizeColumns();

            colStatusAndKey.WidthChanged += columnWidthChanged;
            colTests.WidthChanged        += columnWidthChanged;
            colCompleted.WidthChanged    += columnWidthChanged;
            colDuration.WidthChanged     += columnWidthChanged;
            colServer.WidthChanged       += columnWidthChanged;

            Expanded  += treeExpanded;
            Collapsed += treeCollapsed;
        }