コード例 #1
0
        public static WordDocument AddGoal(this WordDocument source, AnnualGoal goal, bool singleDocument = false, bool last = false)
        {
            //Paragraph p1 = new Paragraph();
            //Paragraph p2 = new Paragraph();
            //Run number = new Run().Stylize(goal.Code, Defaults.FontSize, Defaults.FontFamily, false, true, true);
            //Run colon = new Run().Stylize(":", Defaults.FontSize, Defaults.FontFamily, false, true, false);
            //Run focus = new Run().Stylize(goal.Focus.ToString(), Defaults.FontSize, Defaults.FontFamily, false, true, true);
            //Run annualGoalLabel = new Run().Stylize("ANNUAL GOAL: ", Defaults.FontSize, Defaults.FontFamily, false, true, false);
            //Run annualGoal = new Run().Stylize(goal.ToStatement(), Defaults.FontSize, Defaults.FontFamily, italics: true, bold: true, underline: false);
            //p1.Add(number);
            //p1.Add(colon);
            //p1.Add(focus);
            //p2.Add(annualGoalLabel);
            //p2.Add(annualGoal);
            //source.Body.Add(p1);
            //source.Body.Add(p2);

            source = source.AddParagraph(
                WordFactory.Paragraph(
                    WordFactory.BoldText(goal.Code + ":"),
                    WordFactory.BoldUnderlineText(goal.GetFocus())),
                WordFactory.Paragraph(
                    WordFactory.BoldText("ANNUAL GOAL: "),
                    WordFactory.BoldItalicText(goal.ToStatement())));



            foreach (var objective in goal.Objectives.Objective)
            {
                source = source.AddObjective(objective);
            }

            if (singleDocument)
            {
                if (!last)
                {
                    source = source.AppendPageBreak();
                }
            }


            return(source);
        }