コード例 #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 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);
        }