private void buttonEdit_Click(object sender, EventArgs e) { JiraServerTreeNode selectedNode = (JiraServerTreeNode)serverTree.SelectedNode; AddOrEditJiraServer dialog = new AddOrEditJiraServer(jiraServerModel, selectedNode.Server); DialogResult result = dialog.ShowDialog(); if (result != DialogResult.OK) { return; } jiraServerModel.removeServer(selectedNode.Server.GUID); jiraServerModel.addServer(dialog.Server); selectedNode.Server = dialog.Server; serverTree.ExpandAll(); serverDetails.Text = createServerSummaryText(selectedNode.Server); serverTree.SelectedNode = selectedNode; SomethingChanged = true; }
private void buttonEdit_Click(object sender, EventArgs e) { if (serverTree.SelectedNode is JiraServerTreeNode) { var selectedNode = (JiraServerTreeNode)serverTree.SelectedNode; var dialog = new AddOrEditJiraServer(selectedNode.Server, jiraFacade); var result = dialog.ShowDialog(); if (result != DialogResult.OK) { return; } jiraServerModel.removeServer(selectedNode.Server.GUID); jiraServerModel.addServer(dialog.Server); selectedNode.Server = dialog.Server; selectedNode.ImageIndex = dialog.Server.Enabled ? JIRA_ENABLED : JIRA_DISABLED; selectedNode.SelectedImageIndex = dialog.Server.Enabled ? JIRA_ENABLED : JIRA_DISABLED; serverTree.ExpandAll(); webServerDetails.DocumentText = createServerSummaryText(selectedNode); serverTree.SelectedNode = selectedNode; SomethingChanged = true; } else if (serverTree.SelectedNode is BambooServerTreeNode) { var selectedNode = (BambooServerTreeNode)serverTree.SelectedNode; var dialog = new AddOrEditBambooServer(selectedNode.Server, bambooFacade); var result = dialog.ShowDialog(); if (result != DialogResult.OK) { return; } bambooServerModel.removeServer(selectedNode.Server.GUID); bambooServerModel.addServer(dialog.Server); selectedNode.Server = dialog.Server; selectedNode.ImageIndex = dialog.Server.Enabled ? BAMBOO_ENABLED : BAMBOO_DISABLED; selectedNode.SelectedImageIndex = dialog.Server.Enabled ? BAMBOO_ENABLED : BAMBOO_DISABLED; serverTree.ExpandAll(); webServerDetails.DocumentText = createServerSummaryText(selectedNode); serverTree.SelectedNode = selectedNode; SomethingChanged = true; } }