예제 #1
0
        private void issueDetailsToolStripMenuItem_Click( object sender, EventArgs e )
        {
            Sifter S = new Sifter( ApiKey, Uri );

            SifterApi.Types.IssueDetails ID = S.IssueDetails( Proj, ILE );

            Results.AppendText( "Issue Details Comments Count = " + ID.Comments.Count.ToString() + Environment.NewLine );
        }
예제 #2
0
        private void issueListPage1ToolStripMenuItem_Click( object sender, EventArgs e )
        {
            Sifter S = new Sifter( ApiKey, Uri );

            int Total = 0;
            List<SifterApi.Types.IssueListingEntry> ILEs = S.Issues( Proj, 2, 17, out Total );

            Results.AppendText( "ILEs Count = " + ILEs.Count.ToString() + Environment.NewLine );

            ILE = ILEs[ 0 ];

            EnableMenuItems();
        }
예제 #3
0
        public string GetCommitMessage2( IntPtr hParentWnd, string parameters, string commonURL, string commonRoot, string[] pathList,
            string originalMessage, string bugID, out string bugIDOut, out string[] revPropNames, out string[] revPropValues)
        {
            // sifterapi code
            int first = parameters.IndexOf(",");
            int last = parameters.LastIndexOf(",");
            string Proj = parameters.Substring(0, first);                                // textBoxProj "<enter your api access key here>"
            string ApiKey = parameters.Substring(first + 1, last - first - 1);           // textBoxApiKey "<enter your company name here>"
            string Uri = parameters.Substring(last + 1, parameters.Length - last - 1);   // textBoxUri "<enter your project name here>"

            Sifter S = new Sifter(ApiKey, Uri);

            List<SifterApi.Types.Project> Projs = S.Projects();

            int n = 0;
            string lowerProjs = "";
            do
            {
                lowerProjs = Projs[n].Name.ToLowerInvariant();
                n += 1;
            }
            while (!lowerProjs.Equals(Proj.ToLowerInvariant()) & n < Projs.Count);

            List<SifterApi.Types.IssueListingEntry> ILEs = S.Issues(Projs[n-1]);

            try
            {
                List<TicketItem> tickets = new List<TicketItem>( );
                //tickets.Add(new TicketItem(12, "Service doesn't start on Windows Vista"));
                //tickets.Add(new TicketItem(19, "About box doesn't render correctly in large fonts mode"));

                foreach (SifterApi.Types.IssueListingEntry ile in ILEs)
                    tickets.Add(new TicketItem(ile.Number, ile.Subject));

                revPropNames = new string[0];
                revPropValues = new string[0];
                //revPropNames[0] = "bugtraq:issueIDs";
                //revPropNames[1] = "myownproperty";
                //revPropValues[0] = "13, 16, 17";
                //revPropValues[1] = "myownvalue";

                bugIDOut = bugID;

                MyIssuesForm form = new MyIssuesForm( tickets );
                if ( form.ShowDialog( ) != DialogResult.OK )
                    return originalMessage;

                StringBuilder result = new StringBuilder( originalMessage );
                if ( originalMessage.Length != 0 && !originalMessage.EndsWith( "\n" ) )
                    result.AppendLine( );

                foreach ( TicketItem ticket in form.TicketsFixed )
                {
                    result.AppendFormat( "Fixed #{0}: {1}", ticket.Number, ticket.Summary );
                    result.AppendLine( );
                    selectedTickets.Add( ticket );
                }

                string added = selectedTickets[0].Number.ToString();
                for (n = 1; n < selectedTickets.Count; n++)
                {
                    added += "," + selectedTickets[n].Number.ToString();
                }

                if (bugID.Length == 0)
                {
                    bugIDOut = added;
                }
                else
                {
                    bugIDOut = bugID + "," + added;
                }

                return result.ToString( );
            }
            catch ( Exception ex )
            {
                MessageBox.Show( ex.ToString( ) );
                throw;
            }
        }
예제 #4
0
        public bool ValidateParameters(IntPtr hParentWnd, string parameters)
        {
            // sifterapi code
            int first = parameters.IndexOf(",");
            int last = parameters.LastIndexOf(",");
            string Proj = parameters.Substring(0, first);                                // textBoxProj "<enter your api access key here>"
            string ApiKey = parameters.Substring(first + 1, last - first - 1);           // textBoxApiKey "<enter your company name here>"
            string Uri = parameters.Substring(last + 1, parameters.Length - last - 1);   // textBoxUri "<enter your project name here>"

            Sifter S = new Sifter(ApiKey, Uri);

            List<SifterApi.Types.Project> Projs = S.Projects();

            int n = 0;
            string lowerProjs = "";
            do
            {
                lowerProjs = Projs[n].Name.ToLowerInvariant();
                n += 1;
            }
            while (!lowerProjs.Equals(Proj.ToLowerInvariant()) & n < Projs.Count);

            if (!lowerProjs.Equals(Proj.ToLowerInvariant()))
                return false;

            return true;
        }
예제 #5
0
        private void milestonesToolStripMenuItem_Click( object sender, EventArgs e )
        {
            Sifter S = new Sifter( ApiKey, Uri );

            List<SifterApi.Types.Milestone> Miles = S.Milestones( Proj );

            Results.AppendText( "Milestones Count = " + Miles.Count.ToString() + Environment.NewLine );
        }
예제 #6
0
        private void projectsToolStripMenuItem_Click( object sender, EventArgs e )
        {
            Sifter S = new Sifter( ApiKey, Uri );

            List<SifterApi.Types.Project> Projs = S.Projects();

            Proj = Projs[ 0 ];

            Results.AppendText( "Projects Count = " + Projs.Count.ToString() + Environment.NewLine );

            EnableMenuItems();
        }
예제 #7
0
        private void peopleToolStripMenuItem_Click( object sender, EventArgs e )
        {
            Sifter S = new Sifter( ApiKey, Uri );

            List<SifterApi.Types.Person> People = S.People( Proj );

            Results.AppendText( "People Count = " + People.Count.ToString() + Environment.NewLine );
        }
예제 #8
0
        private void modifiedTodayToolStripMenuItem_Click( object sender, EventArgs e )
        {
            Sifter S = new Sifter( ApiKey, Uri );

            DateTime Today = DateTime.Now;

            List<SifterApi.Types.IssueListingEntry> ILEs = S.Issues( Proj );
            List<SifterApi.Types.IssueDetails> IDs = S.IssueDetails( Proj, ILEs );

            List<SifterApi.Types.IssueDetails> Modified = IDs.Where(
                M => M.Comments.Where(
                    C => CompareDatesForSameDay( C.Updated_At, Today ) == true ).Count() > 0 ).ToList();

            Results.AppendText( "Modified Count = " + Modified.Count.ToString() + Environment.NewLine );
        }