private static string GetFormattedCodePlexWorkItemDetails(WorkItem workItem) { var stringBuilder = new StringBuilder() .AppendLine(MarkdownFormatter.H4(Resources.MigratedCodePlexWorkItemDetails)) .AppendLine(GetFormattedWorkItemId(workItem.Id)); if (!string.IsNullOrEmpty(workItem.AssignedTo)) { stringBuilder.AppendLine(string.Format(GetPropertyFormat(Resources.AssignedTo), workItem.AssignedTo)); } return(stringBuilder .AppendLine(string.Format(GetPropertyFormat(Resources.VoteCount), workItem.VoteCount)) .ToString()); }
private static string GetFormattedAttachmentHyperlinks(IEnumerable <WorkItemFileAttachment> attachments) { bool hasAttachments = attachments?.Any() ?? false; if (hasAttachments) { var stringBuilder = new StringBuilder(); stringBuilder.AppendLine(MarkdownFormatter.H4(Resources.Attachments)); foreach (WorkItemFileAttachment attachment in attachments) { stringBuilder.AppendLine(MarkdownFormatter.HyperLink(attachment.FileName, attachment.DownloadUrl)); } return(stringBuilder.ToString()); } return(string.Empty); }