示例#1
0
        public RedmineIssue GetIssueWithJournals(int id)
        {
            if (BaseUri == null)
            {
                throw new InvalidOperationException("BaseUri is not set");
            }

            var xml   = GetXml("issues/" + id + ".xml?include=journals");
            var issue = RedmineXmlParser.ParseIssues(xml).FirstOrDefault();

            if (issue != null)
            {
                issue.Url = GetIssueUrl(issue);
            }

            return(issue);
        }
示例#2
0
        public RedmineIssue[] GetIssues(string query = "assigned_to_id=me")
        {
            if (BaseUri == null)
            {
                throw new InvalidOperationException("BaseUri is not set");
            }

            var xml    = GetXml($"issues.xml?{query}");
            var issues = RedmineXmlParser.ParseIssues(xml);

            foreach (var issue in issues)
            {
                issue.Url = GetIssueUrl(issue);
            }

            return(issues);
        }
示例#3
0
        public RedmineProject[] GetProjects()
        {
            if (BaseUri == null)
            {
                throw new InvalidOperationException("BaseUri is not set");
            }

            var count    = 1;
            var offset   = 0;
            var projects = new RedmineProject[0].AsEnumerable();

            while (offset < count)
            {
                var xml    = GetXml("projects.xml", offset);
                var header = RedmineXmlParser.ParseHeader(xml);

                projects = projects.Concat(RedmineXmlParser.ParseProjects(xml));

                offset = header.Limit + header.Offset;
                count  = header.Count;
            }

            return(projects.ToArray());
        }