예제 #1
0
        private void RenderChange(ChangeLogChange change)
        {
            this.ChangeLogBox.Inlines.Add(change.Date + " : " + change.Username + " : ");
            var issueHyperLink = new Hyperlink(new Run(change.Version))
            {
                NavigateUri = new Uri(change.WebUrl)
            };

            issueHyperLink.RequestNavigate += Hyperlink_RequestNavigate;
            this.ChangeLogBox.Inlines.Add(issueHyperLink);

            if (change.Issues.Any())
            {
                this.ChangeLogBox.Inlines.Add(System.Environment.NewLine);
                this.ChangeLogBox.Inlines.Add(ChangeLogStrings.Issues + ": ");
                foreach (var issue in change.Issues)
                {
                    RenderIssue(issue);
                }
            }

            this.ChangeLogBox.Inlines.Add(System.Environment.NewLine);
            this.ChangeLogBox.Inlines.Add(change.Comment);
            this.ChangeLogBox.Inlines.Add(System.Environment.NewLine);
            this.ChangeLogBox.Inlines.Add("_________");
            this.ChangeLogBox.Inlines.Add(System.Environment.NewLine + System.Environment.NewLine);
        }
예제 #2
0
        private List <ChangeLogChange> GetChangeLogChanges(ChangeList document, Change toBuildChange)
        {
            this._log.Info("Building list of changes up to build " + toBuildChange.Id);
            var changes = new List <ChangeLogChange>();

            foreach (var current in document.Changes.Where(c => c.Id <= toBuildChange.Id))
            {
                this._log.Info("Processing " + current.Id);
                var change = this._webRequestHelper.GetXmlWebRequestWithBasicAuth <Change>(
                    _configuration.ChangeProviderConfiguration.BaseUrl + current.Href,
                    _configuration.ChangeProviderConfiguration.Username,
                    _configuration.ChangeProviderConfiguration.Password);
                var changeLogChange = new ChangeLogChange
                {
                    Id      = change.Id.ToString(),
                    Version = change.Version,
                    Comment = change.Comment,
                    Date    = DateTime.ParseExact
                                  (change.Date,
                                  "yyyyMMdd'T'HHmmsszzz",
                                  CultureInfo.InvariantCulture),
                    Username = change.Username,
                    WebUrl   = change.WebUrl
                };
                changes.Add(changeLogChange);
                if (this._issueIdRegex != null)
                {
                    this._log.Info("Scanning for issue ids in " + current.Id);
                    var matches = this._issueIdRegex.Matches(changeLogChange.Comment);
                    foreach (Match match in matches)
                    {
                        var issueId = match.Groups["issueid"];
                        if (!string.IsNullOrEmpty(issueId?.Value))
                        {
                            this._log.Info("Found an issue id in " + current.Id + " with value " + issueId.Value);
                            changeLogChange.Issues.Add(new Issue
                            {
                                Name   = issueId.Value,
                                WebUrl =
                                    this._configuration.ChangeProviderConfiguration.IssueReplacementUrl.Replace(
                                        "{issueid}", issueId.Value)
                            });
                        }
                    }
                }
            }
            this._log.Info("Done, found " + changes.Count + " changes");
            return(changes);
        }