/// <summary>
        /// Function Called when the add button is clicked on the form
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void auditLogAdd_Click(object sender, EventArgs e)
        {
            //Basic validity checking
            if (auditLogText.Text.Length <= 3)
            {
                //we open up message box if there is error
                MessageBox.Show("audit log cannot be left blank or shorter that 4 characters", "Error: Audit log too short", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            //create issue resource from the Sharp Bucket library
            IssuesResource issuesResource = u.V1Api.RepositoriesEndPoint(p.ProjectOwner, p.ProjectName).IssuesResource();
            //Comment is bitbucket/sharpbuckets version of an audit log
            Comment comment = new Comment {
                content = auditLogText.Text
            };
            //issue referse to  a specific issue or bug issues is all of the issues
            IssueResource i = issuesResource.IssueResource(b.BugID);

            //post comment means make a post request(which adds a comment/log)
            i.PostComment(comment);
            //show message box upon successful completion
            MessageBox.Show("Audit Log has been added", "Audit log added", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //calls method on the main window to refresh the audit logs
            mw.ViewAuditLogs(b, p);
            //then close this window
            this.Close();
        }
示例#2
0
        internal BaseBitBucketIssueNumberMessageHandler(SharpBucketV2 bitBucketClient)
        {
            var client = bitBucketClient;

            client.OAuth2ClientCredentials(ConsumerKey, ConsumerSecretKey);

            var repositoriesEndPoint = client.RepositoriesEndPoint();
            var repositoryResource   = repositoriesEndPoint.RepositoryResource(RepositoryOwner, RepositoryName);

            _pullRequestsResource = repositoryResource.PullRequestsResource();
            _issuesResource       = repositoryResource.IssuesResource();
        }
        protected void Init()
        {
            ExistingRepository = SampleRepositories.BotTestRepository.IssuesResource();

            NotExistingRepository = SampleRepositories.NotExistingRepository.IssuesResource();
        }