当前位置: 首页>>代码示例>>C#>>正文


C# BaseColor.Darker方法代码示例

本文整理汇总了C#中iTextSharp.text.BaseColor.Darker方法的典型用法代码示例。如果您正苦于以下问题:C# BaseColor.Darker方法的具体用法?C# BaseColor.Darker怎么用?C# BaseColor.Darker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iTextSharp.text.BaseColor的用法示例。


在下文中一共展示了BaseColor.Darker方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: QuestionReport

        public PdfPTable QuestionReport(String path, ViewModels.PollReportViewModel model,String entity)
        {
            if (model.selectedEntities.Count == 0)
            {
                PdfPTable table = new PdfPTable(4);
                int[] width = new int[4] { 2, 15, 12, 6 };
                table.WidthPercentage = 100;
                table.SetWidths(width);
                Phrase phrase = new Phrase("#", font);
                BaseColor basecolor = new BaseColor(232, 238, 244);
                BaseColor heading = new BaseColor(232, 238, 0);
                heading.Darker();
                heading.Darker();
                if (entity != null)
                {
                    PdfPCell entityline = new PdfPCell(new Phrase("Entity: " + entity, font));
                    entityline.BackgroundColor = heading;
                    entityline.Colspan = 4;
                    table.AddCell(entityline);
                }
                if (model.tick != null)
                {
                    String line;
                    if (model.include) line = "Include ";
                    else line = "Exclude ";
                    line += model.field.name + ", Values: ";
                    foreach (string i in model.tick) line += i + ", ";
                    line = line.Remove(line.Length - 2);
                    PdfPCell demo = new PdfPCell(new Phrase(line + entity, font));
                    demo.BackgroundColor = heading;
                    demo.Colspan = 4;
                    table.AddCell(demo);
                }
                table.AddCell(new PdfPCell(new PdfPCell(new Phrase(phrase)) { BackgroundColor = basecolor }));
                phrase.Clear();
                phrase.Add("Question");
                table.AddCell(new PdfPCell(new PdfPCell(new Phrase(phrase)) { BackgroundColor = basecolor }));
                phrase.Clear();
                phrase.Add("Answers");
                table.AddCell(new PdfPCell(new PdfPCell(new Phrase(phrase)) { BackgroundColor = basecolor }));
                phrase.Clear();
                phrase.Add("Number of Responses");
                table.AddCell(new PdfPCell(new PdfPCell(new Phrase(phrase)) { BackgroundColor = basecolor }));
                foreach (var question in model.questions)
                {
                    if (question.deletionTime == null)
                    {
                        phrase.Clear();
                        phrase.Add(question.questionNumber.ToString());
                        table.AddCell(new Phrase(phrase));
                        phrase.Clear();
                        phrase.Add(question.question);
                        table.AddCell(new Phrase(phrase));
                        PdfPTable options = new PdfPTable(2);
                        options.SetWidths(new int[2] { 4, 2 });
                        foreach (var answer in model.responses[question])
                        {
                            phrase.Clear();
                            phrase.Add(answer.Key);
                            options.AddCell(new Phrase(phrase));
                            phrase.Clear();
                            phrase.Add(answer.Value.ToString());
                            options.AddCell(new Phrase(phrase));
                        }

                        PdfPCell full = new PdfPCell(options);
                        full.Colspan = 2;
                        table.AddCell(full);
                    }
                }
                return table;
            }
            else
            {
                PdfPTable table = new PdfPTable(3 + model.selectedEntities.Count);
                table.WidthPercentage = 100;
                List<int> widthList = new List<int>();
                widthList.Add(2);
                widthList.Add(15);
                widthList.Add(12);
                widthList.Add(6);
                for (int i = 0; i < model.selectedEntities.Count-1; i++)
                {
                    widthList.Add(6);
                }
                table.SetWidths(widthList.ToArray());
                Phrase phrase = new Phrase("#", font);
                BaseColor basecolor = new BaseColor(232, 238, 244);
                BaseColor heading = new BaseColor(232, 238, 0);
                heading.Darker();
                heading.Darker();
                if (model.selectedEntities.Count > 0)
                {
                    Phrase entities = new Phrase("", new Font(FontFactory.GetFont("Verdana", 14)));
                    int i = 0;
                    if (model.selectedEntities.Count == 1) entities.Add("Entity: ");
                    else entities.Add("Entities: ");
                    foreach (Models.Entity ent in model.selectedEntities)
                    {
                        if (i == model.selectedEntities.Count - 1) entities.Add(ent.name);
//.........这里部分代码省略.........
开发者ID:thebinarysearchtree,项目名称:dbPoll,代码行数:101,代码来源:CodeFile1.cs


注:本文中的iTextSharp.text.BaseColor.Darker方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。