Exemplo n.º 1
0
 internal AsyncDiscussionHelper(MergeRequestKey mrk, string title,
                                User currentUser, GitLab.Shortcuts shortcuts)
 {
     _creator       = shortcuts.GetDiscussionCreator(mrk, currentUser);
     _uploadsPrefix = StringUtils.GetUploadsPrefix(mrk.ProjectKey);
     _title         = title;
 }
Exemplo n.º 2
0
        async private static Task <bool> addComment(
            MergeRequestKey mrk, User currentUser, string commentBody, Shortcuts shortcuts)
        {
            if (String.IsNullOrEmpty(commentBody))
            {
                return(false);
            }

            try
            {
                IDiscussionCreator creator = shortcuts.GetDiscussionCreator(mrk, currentUser);
                await creator.CreateNoteAsync(new CreateNewNoteParameters(commentBody));

                return(true);
            }
            catch (DiscussionCreatorException ex)
            {
                MessageBox.Show("Failed to create a note in the new merge request", "Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                ExceptionHandlers.Handle("Failed to create a note", ex);
            }
            return(false);
        }