當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。