public ProjectConfiguration(
            Guid?serverTypeToCreate, JiraServerModel jiraServerModel, BambooServerModel bambooServerModel,
            AbstractJiraServerFacade jiraFacade, BambooServerFacade bambooFacade)
        {
            InitializeComponent();

            this.jiraServerModel   = jiraServerModel;
            this.bambooServerModel = bambooServerModel;
            this.jiraFacade        = jiraFacade;
            this.bambooFacade      = bambooFacade;

            var jiraServers   = jiraServerModel.getAllServers();
            var bambooServers = bambooServerModel.getAllServers();

            imageList = new ImageList();
            imageList.Images.Add(Resources.folder_jira);
            imageList.Images.Add(Resources.folder_bamboo);
            imageList.Images.Add(Resources.tab_jira);
            imageList.Images.Add(Resources.tab_jira_grey);
            imageList.Images.Add(Resources.tab_bamboo);
            imageList.Images.Add(Resources.tab_bamboo_grey);

            serverTree.ImageList = imageList;

            serverTree.Nodes.Add(jiraRoot);
            serverTree.Nodes.Add(bambooRoot);
//            serverTree.Nodes.Add(crucibleRoot);
//            serverTree.Nodes.Add(fisheyeRoot);

            foreach (var server in jiraServers)
            {
                jiraRoot.Nodes.Add(new JiraServerTreeNode(jiraServerModel, server, server.Enabled ? JIRA_ENABLED : JIRA_DISABLED));
            }

            foreach (var server in bambooServers)
            {
                bambooRoot.Nodes.Add(new BambooServerTreeNode(bambooServerModel, server, server.Enabled ? BAMBOO_ENABLED : BAMBOO_DISABLED));
            }

            StartPosition = FormStartPosition.CenterParent;

            serverTree.ExpandAll();

            if (serverTypeToCreate != null)
            {
                if (serverTypeToCreate.Value.Equals(Server.JiraServerTypeGuid))
                {
                    serverTree.SelectedNode = jiraRoot;
                }
                else if (serverTypeToCreate.Value.Equals(Server.BambooServerTypeGuid))
                {
                    serverTree.SelectedNode = bambooRoot;
                }
            }
        }
Ejemplo n.º 2
0
        public AddOrEditBambooServer(BambooServer server, BambooServerFacade facade)
        {
            this.facade = facade;
            InitializeComponent();

            editing = server != null;

            this.server = new BambooServer(server);

            Text = editing ? "Edit Bamboo Server" : "Add Bamboo Server";
            buttonAddOrEdit.Text = editing ? "Apply Changes" : "Add Server";

            if (editing)
            {
                if (server != null)
                {
                    name.Text     = server.Name;
                    url.Text      = server.Url;
                    user.Text     = server.UserName;
                    password.Text = server.Password;

                    radioUseFavourites.Checked  = server.UseFavourites;
                    radioSelectManually.Checked = !server.UseFavourites;
                    if (server.PlanKeys != null)
                    {
                        planKeys.AddRange(server.PlanKeys);
                    }

                    checkShowBranches.Checked = server.ShowBranches;
                    checkMyBranches.Checked   = server.ShowMyBranchesOnly;
                    checkShowBranches.Enabled = false;
                    checkMyBranches.Enabled   = false;

                    getServerVersion();

                    checkEnabled.Checked      = server.Enabled;
                    checkShared.Checked       = server.IsShared;
                    checkDontUseProxy.Checked = server.NoProxy;
                }
            }
            else
            {
                ++invocations;
                name.Text = "Bamboo Server #" + invocations;
                buttonAddOrEdit.Enabled = false;

                radioUseFavourites.Checked = true;
                buttonGetBuilds.Enabled    = false;
                checkedListBuilds.Enabled  = false;

                checkEnabled.Checked      = true;
                checkShared.Checked       = false;
                checkDontUseProxy.Checked = false;
                checkShowBranches.Checked = true;
                checkShowBranches.Enabled = true;
                checkMyBranches.Enabled   = true;
            }

            StartPosition = FormStartPosition.CenterParent;
            toolTip.SetToolTip(checkMyBranches, "Only show branches where the last commit is mine");
        }
Ejemplo n.º 3
0
 public TestBambooConnection(BambooServerFacade facade, BambooServer server) : base(server)
 {
     this.facade = facade;
     this.server = server;
 }