async private Task closeMergeRequestAsync(string hostname, FullMergeRequestKey item)
        {
            MergeRequestKey mrk     = new MergeRequestKey(item.ProjectKey, item.MergeRequest.IId);
            string          message =
                "Do you really want to close (cancel) merge request? It will not be merged to the target branch.";

            if (MessageBox.Show(message, "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                GitLabInstance gitLabInstance = new GitLabInstance(hostname, Program.Settings);
                await MergeRequestEditHelper.CloseMergeRequest(gitLabInstance, _modificationNotifier, mrk);

                string statusMessage = String.Format("Merge Request !{0} has been closed", mrk.IId);
                labelWorkflowStatus.Text = statusMessage;
                Trace.TraceInformation("[MainForm] {0}", statusMessage);

                requestUpdates(null, new int[] { Constants.NewOrClosedMergeRequestRefreshListTimerInterval });
            }
            else
            {
                Trace.TraceInformation("[MainForm] User declined to close a merge request");
            }
        }
Exemple #2
0
        async private Task closeMergeRequestAsync(FullMergeRequestKey item)
        {
            MergeRequestKey mrk     = new MergeRequestKey(item.ProjectKey, item.MergeRequest.IId);
            string          message =
                "Do you really want to close (cancel) merge request? It will not be merged to the target branch.";

            if (MessageBox.Show(message, "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                await MergeRequestEditHelper.CloseMergeRequest(mrk, _shortcuts);

                string statusMessage = String.Format("Merge Request !{0} has been closed", mrk.IId);
                addOperationRecord(statusMessage);

                requestUpdates(EDataCacheType.Live, null, new int[] {
                    Program.Settings.NewOrClosedMergeRequestRefreshListDelayMs
                });
            }
            else
            {
                Trace.TraceInformation("[MainForm] User declined to close a merge request");
            }
        }