private void buttonOk_Click(object sender, EventArgs e)
        {
            setAllEnabled(false);
            setThrobberVisible(true);

            ICollection <JiraField> updatedFields = mergeFieldsFromEditors();
            Thread t = PlvsUtils.createThread(delegate {
                try {
                    SmartJiraServerFacade.Instance.runIssueActionWithParams(
                        issue, action, updatedFields, textComment.Text.Length > 0 ? textComment.Text : null);
                    var newIssue = SmartJiraServerFacade.Instance.getIssue(issue.Server, issue.Key);
                    UsageCollector.Instance.bumpJiraIssuesOpen();
                    status.setInfo("Action \"" + action.Name + "\" successfully run on issue " + issue.Key);
                    this.safeInvoke(new MethodInvoker(delegate {
                        Close();
                        model.updateIssue(newIssue);
                        if (onFinish != null)
                        {
                            onFinish();
                        }
                    }));
                }
                catch (Exception ex) {
                    this.safeInvoke(new MethodInvoker(() => showErrorAndResumeEditing(ex)));
                }
            });

            t.Start();
        }
 private void logWorkWorker(Action action, Action finished, bool closeDialogOnFinish)
 {
     try {
         status.setInfo("Logging work for issue " + issue.Key + "...");
         action();
         status.setInfo("Logged work for issue " + issue.Key);
         UsageCollector.Instance.bumpJiraIssuesOpen();
         JiraIssue updatedIssue = facade.getIssue(issue.Server, issue.Key);
         parent.safeInvoke(new MethodInvoker(() => {
             model.updateIssue(updatedIssue);
             if (activeIssueManager.isActive(issue))
             {
                 activeIssueManager.resetTimeSpent();
             }
         }));
     } catch (Exception e) {
         status.setError("Failed to log work for issue " + issue.Key, e);
     }
     parent.safeInvoke(new MethodInvoker(() => {
         if (closeDialogOnFinish)
         {
             Close();
         }
         if (finished != null)
         {
             finished();
         }
     }));
 }
        private void runActionLocally(JiraNamedEntity action)
        {
            status.setInfo("Running action \"" + action.Name + "\" on issue " + issue.Key + "...");
            JiraServerFacade.Instance.runIssueActionWithoutParams(issue, action);
            status.setInfo("Action \"" + action.Name + "\" successfully run on issue " + issue.Key);
            var newIssue = JiraServerFacade.Instance.getIssue(issue.Server, issue.Key);

            Invoke(new MethodInvoker(() => model.updateIssue(newIssue)));
        }
示例#4
0
 private void updateModelAndResetToInitialState(JiraIssue issue, bool add)
 {
     if (issue != null)
     {
         model.updateIssue(issue);
         textHistory.Text =
             DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString()
             + " - " + issue.Key + (worker.CanAdd ? (add ? " [added]" : " [moved]") : "") + "\r\n" + textHistory.Text;
     }
     AllowDrop      = true;
     labelInfo.Text = worker.InitialText;
 }
示例#5
0
        private static void runActionWithoutFields(
            Control owner, JiraNamedEntity action, JiraIssueListModel model,
            JiraIssue issue, StatusLabel status, Action onFinish)
        {
            status.setInfo("Running action \"" + action.Name + "\" on issue " + issue.Key + "...");
            SmartJiraServerFacade.Instance.runIssueActionWithoutParams(issue, action);
            status.setInfo("Action \"" + action.Name + "\" successfully run on issue " + issue.Key);
            var newIssue = SmartJiraServerFacade.Instance.getIssue(issue.Server, issue.Key);

            UsageCollector.Instance.bumpJiraIssuesOpen();
            owner.Invoke(new MethodInvoker(() => { model.updateIssue(newIssue); if (onFinish != null)
                                                   {
                                                       onFinish();
                                                   }
                                           }));
        }
 private void applyChanges()
 {
     try {
         facade.updateIssue(issue, new List <JiraField> {
             field
         });
         JiraIssue updatedIssue = facade.getIssue(issue.Server, issue.Key);
         this.safeInvoke(new MethodInvoker(delegate {
             Close();
             model.updateIssue(updatedIssue);
         }));
     } catch (Exception e) {
         this.safeInvoke(new MethodInvoker(delegate {
             PlvsUtils.showError("Failed to apply changes", e);
             Close();
         }));
     }
 }
 public void updateIssue(JiraIssue issue)
 {
     model.updateIssue(issue);
 }