/// <summary>
        /// Creates the release note.
        /// </summary>
        /// <param name="request">The request.</param>
        public void SaveReleaseNote(ReleaseNoteRequest request)
        {
            this.ConnectToTfs(request);

            var workItems = this.GenerateReleaseNoteWorkItems();

            var publisher = new PdfReleaseNotePublisher();

            publisher.Publish(request, workItems);
        }
        /// <summary>
        /// Connects to TFS.
        /// </summary>
        /// <param name="request">The request.</param>
        private void ConnectToTfs(ReleaseNoteRequest request)
        {
            // Connect to Team Foundation Server
            var tfsUri = new Uri(request.TfsServerUrl);
            var teamProjectCollection = new TfsTeamProjectCollection(tfsUri);

            this.workItemStore = teamProjectCollection.GetService <WorkItemStore>();
            var tfsTeamProject = workItemStore.Projects[request.TfsProject];
            var tfsQueryFolder = tfsTeamProject.QueryHierarchy[request.TfsQueryHierarchy] as QueryFolder;

            if (tfsQueryFolder != null)
            {
                this.tfsQueryItem = tfsQueryFolder[request.TfsQueryName];
            }
        }
Пример #3
0
        /// <summary>
        /// Publishes the specified release note request.
        /// </summary>
        /// <param name="releaseNoteRequest">The release note request.</param>
        /// <param name="releaseNoteWorkItems">The release note work items.</param>
        public void Publish(ReleaseNoteRequest releaseNoteRequest, List <WorkItem> releaseNoteWorkItems)
        {
            this.request   = releaseNoteRequest;
            this.workItems = releaseNoteWorkItems.Where(c => c.Iteration.EndsWith(string.Format(" {0}", request.IterationNumber))).ToList();

            // Start the document by generating the front cover
            this.GenerateCover();

            this.doc.Info.Title = string.Format(
                "FitApp Release Note - Build {0} - Iteration {1}",
                request.BuildNumber,
                request.IterationNumber);
            this.doc.Info.Author = "Boardwalk IT";

            // Write the work items
            WriteWorkItems();

            // Save
            this.doc.Save(request.OutputFile);
        }