コード例 #1
0
ファイル: LatexHelpers.cs プロジェクト: uncas/hibes
        private static void AppendIssueEstimateTable(IEnumerable<IssueEvaluation> issueEstimates
            , bool showEmptyRows
            , LatexDocument document)
        {
            var priorityColumn
                = new LatexColumn<IssueEvaluation>
                (Resources.Phrases.Priority
                , (IssueEvaluation ie)
                    => ie.Priority.ToString
                    (CultureInfo.CurrentCulture)
                , ColumnAlignment.Center);

            var projectColumn
                = new LatexColumn<IssueEvaluation>
                (Resources.Phrases.Project
                , (IssueEvaluation ie)
                    => ie.ProjectName);

            int maxCharactersInIssueTitle = 45;

            var issueTitleColumn
                = new LatexColumn<IssueEvaluation>
                (Resources.Phrases.Issue
                , (IssueEvaluation ie)
                    => ShortenText(ie.IssueTitle
                        , maxCharactersInIssueTitle));

            var elapsedDaysColumn
                = new LatexColumn<IssueEvaluation>
                (Resources.Phrases.Elapsed
                , (IssueEvaluation ie)
                    => string.Format(CultureInfo.CurrentCulture
                    , "{0:N1}"
                    , ie.ElapsedDays)
                , ColumnAlignment.Right);

            var remainingDaysColumn
                = new LatexColumn<IssueEvaluation>
                (Resources.Phrases.Remaining
                , (IssueEvaluation ie)
                    => GetDaysRemainingText(ie.Average)
                , ColumnAlignment.Right);

            var totalDaysColumn
                = new LatexColumn<IssueEvaluation>
                (Resources.Phrases.Total
                , (IssueEvaluation ie)
                    => GetDaysRemainingText(ie.TotalDays)
                , ColumnAlignment.Right);

            Func<IssueEvaluation, bool> showRow = null;
            if (!showEmptyRows)
            {
                showRow = (IssueEvaluation ie)
                    => ie.Average.HasValue;
            }

            document.AppendTable<IssueEvaluation>
               (issueEstimates
               , showRow
               , priorityColumn
               , projectColumn
               , issueTitleColumn
               , elapsedDaysColumn
               , remainingDaysColumn
               , totalDaysColumn);
        }
コード例 #2
0
ファイル: LatexHelpers.cs プロジェクト: uncas/hibes
        private string GetLatexFromEstimate(int? projectId
            , int? maxPriority)
        {
            LatexDocument document = new LatexDocument();

            document.AppendText("@TOP@");

            AppendIssueEstimateTables
                (projectId
                , maxPriority
                , document);

            document.AppendSection(Resources.Phrases.Date);

            AppendPersonConfidenceDateTable
                (projectId
                , maxPriority
                , document);

            document.AppendText("@BOTTOM@");

            return document.ToString();
        }
コード例 #3
0
ファイル: LatexHelpers.cs プロジェクト: uncas/hibes
        private void AppendIssueEstimateTables(int? projectId
            , int? maxPriority
            , LatexDocument document)
        {
            var issueEstimates
                = projectController.GetIssueEstimates
                (projectId, maxPriority);

            document.AppendSection(Resources.Phrases.Issues);
            AppendIssueEstimateTable
                (issueEstimates
                , true
                , document);

            foreach (var personEvaluation
                in projectController.GetEvaluationsPerPerson
                (projectId, maxPriority))
            {
                document.AppendSection
                    (personEvaluation.PersonName);
                AppendIssueEstimateTable
                    (personEvaluation.GetIssueEvaluations()
                    , false
                    , document);
            }
        }
コード例 #4
0
ファイル: LatexHelpers.cs プロジェクト: uncas/hibes
        private void AppendPersonConfidenceDateTable(int? projectId
            , int? maxPriority
            , LatexDocument document)
        {
            var personConfidenceDates
                = projectController.GetConfidenceDatesPerPerson
                (projectId, maxPriority);

            var nameColumn
                = new LatexColumn<PersonConfidenceDates>
                (Resources.Phrases.Person
                , (PersonConfidenceDates to)
                    => to.PersonName);

            var lowColumn
                = new LatexColumn<PersonConfidenceDates>
                (LatexPercentageStringFromDouble
                    (App.ConfidenceLow)
                , (PersonConfidenceDates to)
                    => to.CompletionDateLow.ToShortDateString()
                , ColumnAlignment.Right);

            var mediumColumn
                = new LatexColumn<PersonConfidenceDates>
                (LatexPercentageStringFromDouble
                    (App.ConfidenceMedium)
                , (PersonConfidenceDates to)
                    => to.CompletionDateMedium.ToShortDateString()
                , ColumnAlignment.Right);

            var highColumn
                = new LatexColumn<PersonConfidenceDates>
                (LatexPercentageStringFromDouble
                    (App.ConfidenceHigh)
                , (PersonConfidenceDates to)
                    => to.CompletionDateHigh.ToShortDateString()
                , ColumnAlignment.Right);

            document.AppendTable<PersonConfidenceDates>
                (personConfidenceDates
                , nameColumn
                , lowColumn
                , mediumColumn
                , highColumn);
        }
コード例 #5
0
 // start building a new document
 public void OpenDocument()
 {
     doc = new LatexDocument();
 }