private BuildNode getSelectedBuildNode()
        {
            TreeNodeAdv node = buildTree.SelectedNode;
            BuildNode   n    = node == null ? null : node.Tag as BuildNode;

            return(n);
        }
        private void buildTreeSelectionChanged(object sender, EventArgs e)
        {
            updateBuildListButtons();
            BuildNode bn = getSelectedBuildNode();

            buildHistoryTable.showHistoryForBuild(bn != null ? bn.Build : null);
        }
        private void displaySummary()
        {
            summaryLoaded = false;

            StringBuilder sb = new StringBuilder();

            BuildNode bn = new BuildNode(build);

            sb.Append("<html>\n<head>\n").Append(Resources.summary_and_description_css)
            .Append("\n</head>\n<body class=\"description\">\n")
            .Append(
                string.Format(Resources.build_summary_html,
                              build.Number,
                              build.Key,
                              bn.Reason,
                              bn.Tests,
                              build.RelativeTime,
                              build.Duration,
                              getServerHtml(),
                              build.Result,
                              build.Result.GetColorValue(),
                              getArtifactsHtml(),
                              getRelatedIssuesHtml()))
            .Append("\n</body>\n</html>\n");

            webSummary.DocumentText = sb.ToString();
        }
        private void updateBuildListButtons()
        {
            BuildNode n = getSelectedBuildNode();

            buttonViewInBrowser.Enabled = n != null;
            buttonOpen.Enabled          = n != null;
            buttonRunBuild.Enabled      = n != null;
        }
        private void runOnSelectedNode(SelectedBuildAction action)
        {
            BuildNode n = getSelectedBuildNode();

            if (n != null)
            {
                action(n.Build);
            }
        }