/// <summary>
        /// Adds rich formatted text to the specified text block content
        /// </summary>
        /// <param name="content"></param>
        private void AddFormattedTextToContent(NTextBlockContent content)
        {
            content.Blocks.Add(GetTitleParagraph("Bullet lists allow you to apply automatic numbering on paragraphs or groups of blocks.", 1));

            // setting bullet list template type
            {
                content.Blocks.Add(GetTitleParagraph("Following are bullet lists with different formatting", 2));

                ENBulletListTemplateType[] values = NEnum.GetValues <ENBulletListTemplateType>();
                string[] names = NEnum.GetNames <ENBulletListTemplateType>();

                string itemText = "Bullet List Item";

                for (int i = 0; i < values.Length - 1; i++)
                {
                    NGroupBlock group = new NGroupBlock();
                    content.Blocks.Add(group);
                    group.MarginTop    = 10;
                    group.MarginBottom = 10;

                    NBulletList bulletList = new NBulletList(values[i]);
                    content.BulletLists.Add(bulletList);

                    for (int j = 0; j < 3; j++)
                    {
                        NParagraph    paragraph = new NParagraph(itemText + j.ToString());
                        NBulletInline bullet    = new NBulletInline();
                        bullet.List      = bulletList;
                        paragraph.Bullet = bullet;

                        group.Blocks.Add(paragraph);
                    }
                }
            }

            // nested bullet lists
            {
                content.Blocks.Add(GetTitleParagraph("Following is an example of bullets with different bullet level", 2));

                NBulletList bulletList = new NBulletList(ENBulletListTemplateType.Decimal);
                content.BulletLists.Add(bulletList);

                NGroupBlock group = new NGroupBlock();
                content.Blocks.Add(group);

                for (int i = 0; i < 3; i++)
                {
                    NParagraph par = new NParagraph("Bullet List Item" + i.ToString(), bulletList, 0);
                    group.Blocks.Add(par);

                    for (int j = 0; j < 2; j++)
                    {
                        NParagraph nestedPar = new NParagraph("Nested Bullet List Item" + i.ToString(), bulletList, 1);
                        nestedPar.MarginLeft = 10;

                        group.Blocks.Add(nestedPar);
                    }
                }
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="section"></param>
        /// <param name="bulletListType"></param>
        /// <param name="items"></param>
        /// <param name="itemText"></param>
        private void CreateSampleBulletList(NSection section, ENBulletListTemplateType bulletListType, int items, string itemText)
        {
            NBulletList bulletList = new NBulletList(bulletListType);

            m_RichText.Content.BulletLists.Add(bulletList);

            for (int i = 0; i < items; i++)
            {
                NParagraph par = new NParagraph(itemText + i.ToString());
                par.SetBulletList(bulletList, 0);
                section.Blocks.Add(par);
            }
        }
        protected override void PopulateRichText()
        {
            NSection section = new NSection();

            m_RichText.Content.Sections.Add(section);

            section.Blocks.Add(GetDescriptionBlock("Bullet Lists", "Bullet lists allow you to apply automatic numbering on paragraphs or groups of blocks.", 1));

            section.Blocks.Add(GetDescriptionBlock("Simple bullet list", "Following is a bullet list with default formatting.", 2));

            CreateSampleBulletList(section, ENBulletListTemplateType.Bullet, 3, "Bullet List Item");

            // setting bullet list template type
            {
                section.Blocks.Add(GetDescriptionBlock("Bullet Lists with Different Template", "Following are bullet lists with different formatting", 2));

                ENBulletListTemplateType[] values = NEnum.GetValues <ENBulletListTemplateType>();
                string[] names = NEnum.GetNames <ENBulletListTemplateType>();

                for (int i = 0; i < values.Length - 1; i++)
                {
                    CreateSampleBulletList(section, values[i], 3, names[i] + " bullet list item ");
                }
            }

            // nested bullet lists
            {
                section.Blocks.Add(GetDescriptionBlock("Bullet List Levels", "Following is an example of bullet list levels", 2));

                NBulletList bulletList = new NBulletList(ENBulletListTemplateType.Decimal);
                m_RichText.Content.BulletLists.Add(bulletList);

                for (int i = 0; i < 3; i++)
                {
                    NParagraph par1 = new NParagraph("Bullet List Item" + i.ToString());
                    par1.SetBulletList(bulletList, 0);
                    section.Blocks.Add(par1);

                    for (int j = 0; j < 2; j++)
                    {
                        NParagraph par2 = new NParagraph("Nested Bullet List Item" + i.ToString());
                        par2.SetBulletList(bulletList, 1);
                        par2.MarginLeft = 20;
                        section.Blocks.Add(par2);
                    }
                }
            }
        }
            public override NDocumentBlock CreateDocument()
            {
                NDocumentBlock document = base.CreateDocument();
                NSection       section  = document.Sections[0];

                // Add bullet lists of all unordered types
                ENBulletListTemplateType[] bulletTypes = new ENBulletListTemplateType[] { ENBulletListTemplateType.Bullet };

                for (int i = 0; i < bulletTypes.Length; i++)
                {
                    NBulletList bulletList = new NBulletList(ENBulletListTemplateType.Bullet);
                    document.BulletLists.Add(bulletList);

                    for (int j = 1; j <= 3; j++)
                    {
                        NParagraph paragraph = new NParagraph("This is parargaph number " + j.ToString() +
                                                              ". This paragraph is contained in a bullet list of type " + bulletTypes[i].ToString());
                        paragraph.SetBulletList(bulletList, 0);
                        section.Blocks.Add(paragraph);
                    }
                }

                // Add bullet lists of all ordered types
                bulletTypes = new ENBulletListTemplateType[] { ENBulletListTemplateType.Decimal, ENBulletListTemplateType.LowerAlpha,
                                                               ENBulletListTemplateType.LowerRoman, ENBulletListTemplateType.UpperAlpha, ENBulletListTemplateType.UpperRoman };

                for (int i = 0; i < bulletTypes.Length; i++)
                {
                    section.Blocks.Add(new NParagraph());

                    NBulletList bulletList = new NBulletList(bulletTypes[i]);

                    for (int j = 1; j <= 3; j++)
                    {
                        NParagraph paragraph = new NParagraph("Bullet List Item " + j.ToString(), bulletList, 0);
                        section.Blocks.Add(paragraph);

                        for (int z = 1; z <= 3; z++)
                        {
                            NParagraph par2 = new NParagraph("Bullet List Sub Item " + z.ToString(), bulletList, 1);
                            section.Blocks.Add(par2);
                        }
                    }
                }

                return(document);
            }
        /// <summary>
        ///
        /// </summary>
        protected override void PopulateRichText()
        {
            NSection section = new NSection();

            m_RichText.Content.Sections.Add(section);

            section.Blocks.Add(GetDescriptionBlock("Bullet List Templates", "Bullet lists templates control the appearance of bullet items for a particular level.", 1));
            section.Blocks.Add(GetDescriptionBlock("Setting bullet list template", "Following is a nested bullet list that has a custom defined bullet list template.", 2));

            // create a custom bullet list template
            NBulletList      bulletList       = new NBulletList();
            NBulletListLevel bulletListLevel1 = new NBulletListLevel();

            bulletListLevel1.BulletType = ENBulletType.UpperRoman;
            bulletListLevel1.Format     = "\\0.";

            bulletList.Levels.Add(bulletListLevel1);

            NBulletListLevel bulletListLevel2 = new NBulletListLevel();

            bulletListLevel2.BulletType = ENBulletType.Text;
            bulletListLevel2.BulletText = new string((char)ENBulletChar.BlackCircle, 1);

            bulletList.Levels.Add(bulletListLevel2);

            // Create the first bullet list
            for (int i = 0; i < 3; i++)
            {
                section.Blocks.Add(new NParagraph("Bullet List Item" + i.ToString(), bulletList, 0));

                for (int j = 0; j < 2; j++)
                {
                    section.Blocks.Add(new NParagraph("Nested Bullet List Item" + i.ToString(), bulletList, 1));
                }
            }
        }
        protected override void PopulateRichText()
        {
            {
                NSection headerSection = new NSection();
                m_RichText.Content.Sections.Add(headerSection);

                headerSection.Blocks.Add(CreateTitleParagraph("Welcome to our annual report\nFurther information on Sample Group can be found at:\n www.samplegroup.com"));
                headerSection.Blocks.Add(CreateContentParagraph("Sample Group is a diversified international market infrastructure and capital markets business sitting at the heart of the world’s financial community."));
                headerSection.Blocks.Add(CreateContentParagraph("The Group operates a broad range of international equity, bond and derivatives markets, including Stock Exchange; Europe’s leading fixed income market; and a pan-European equities MTF. Through its platforms, the Group offers international business and investors unrivalled access to Europe’s capital markets."));
                headerSection.Blocks.Add(CreateContentParagraph("Post trade and risk management services are a significant part of the Group’s business operations. In addition to majority ownership of multi-asset global CCP operator, Sunset Group, the Group operates G&B, a clearing house; Monte Span, the European settlement business; and AutoSettle, the Group’s newly established central securities depository based in Luxembourg. The Group is a global leader in indexing and analytic solutions. The Group also provides customers with an extensive range of real time and reference data products. The Group is a leading developer of high performance trading platforms and capital markets software for customers around the world, through MillenniumIT. Since December 2014, the Group has owned Bonita Investments, an investment management business."));
                headerSection.Blocks.Add(CreateContentParagraph("Headquartered in London, with significant operations in North America, China and Russia, the Group employs approximately 6000 people"));
            }

            {
                NSection financialHighlightsSection = new NSection();
                financialHighlightsSection.BreakType = ENSectionBreakType.NextPage;
                m_RichText.Content.Sections.Add(financialHighlightsSection);
                financialHighlightsSection.Blocks.Add(CreateTitleParagraph("Financial highlights"));
                financialHighlightsSection.Blocks.Add(CreateContentParagraph("The following charts provide insight to the group's total income, operating profit, and earnings per share for the years since 2008."));

                NSize chartSize = new NSize(300, 200);
                {
                    NTable table = new NTable();
                    table.AllowSpacingBetweenCells = false;
                    table.Columns.Add(new NTableColumn());
                    table.Columns.Add(new NTableColumn());
                    financialHighlightsSection.Blocks.Add(table);

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);
                        {
                            NTableCell tableCell = new NTableCell();
                            tableCell.Blocks.Add(CreateSampleBarChart(chartSize, "Adjusted total income", new double[] { 674.9, 814.8, 852.9, 1, 213.1, 1, 043.9, 1, 096.4, 1, 381.1 }, new string[] { "2008", "2009", "2010", "2011", "2012", "2013", "2014" }));
                            tableRow.Cells.Add(tableCell);
                        }

                        {
                            NTableCell tableCell = new NTableCell();
                            tableCell.Blocks.Add(CreateSampleBarChart(chartSize, "Adjusted operating profit", new double[] { 341.1, 441.9, 430.2, 514.7, 417.5, 479.9, 558.0 }, new string[] { "2008", "2009", "2010", "2011", "2012", "2013", "2014" }));
                            tableRow.Cells.Add(tableCell);
                        }
                    }

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);
                        {
                            NTableCell tableCell = new NTableCell();
                            tableCell.Blocks.Add(CreateSampleBarChart(chartSize, "Operating profit", new double[] { 283.0, 358.5, 348.4, 353.1, 242.1, 329.4, 346.0 }, new string[] { "2008", "2009", "2010", "2011", "2012", "2013", "2014" }));
                            tableRow.Cells.Add(tableCell);
                        }

                        {
                            NTableCell tableCell = new NTableCell();
                            tableCell.Blocks.Add(CreateSampleBarChart(chartSize, "Adjusted earnings per share", new double[] { 67.9, 92.6, 97.0, 98.6, 75.6, 96.5, 103.3 }, new string[] { "2008", "2009", "2010", "2011", "2012", "2013", "2014" }));
                            tableRow.Cells.Add(tableCell);
                        }
                    }
                }
            }

            {
                NSection operationalHighlights = new NSection();
                operationalHighlights.ColumnCount = 2;
                operationalHighlights.BreakType   = ENSectionBreakType.NextPage;
                operationalHighlights.Blocks.Add(CreateTitleParagraph("Operational highlights"));
                m_RichText.Content.Sections.Add(operationalHighlights);

                operationalHighlights.Blocks.Add(CreateContentParagraph("The Group is delivering on its strategy, leveraging its range of products and services and further diversifying its offering through new product development and strategic investments. A few examples of the progress being made are highlighted below: "));

                operationalHighlights.Blocks.Add(CreateContentParagraph("Capital Markets"));

                {
                    NBulletList bulletList = new NBulletList(ENBulletListTemplateType.Bullet);
                    m_RichText.Content.BulletLists.Add(bulletList);

                    {
                        NParagraph par = CreateContentParagraph("Revenues for calendar year 2014 increased by 12 per cent to £333.2 million (2013: £296.8 million). Primary Markets saw a seven year high in new issue activity with 219 new companies admitted, including AA, the largest UK capital raising IPO of the year");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("UK cash equity average daily value traded increased 15 per cent and average daily number of trades in Italy increased 16 per cent");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("Average daily value traded on Turquoise, our European cash equities MTF, increased 42 per cent to €3.7 billion per day and share of European trading increased to over 9 per cent");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("In Fixed Income, MTS cash and BondVision value traded increased by 32 per cent, while MTS Repo value traded increased by 3 per cent");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }
                }
                operationalHighlights.Blocks.Add(CreateContentParagraph("Post Trade Services"));
                {
                    NBulletList bulletList = new NBulletList(ENBulletListTemplateType.Bullet);
                    m_RichText.Content.BulletLists.Add(bulletList);

                    {
                        NParagraph par = CreateContentParagraph("Revenues for calendar year 2014 increased by 3 per cent in constant currency terms. In sterling terms revenues declined by 2 per cent to £96.5 million");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("Our Group  cleared 69.7 million equity trades, up 16 per cent and 39.0 million derivative contracts up 20 per cent");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("Our Group is the largest CSD entering the first wave of TARGET2-Securities from June 2015. Successful testing with the European Central Bank finished in December 2014. In addition, Our Group moved settlement of contracts executed on the Italian market from T+3 to T+2 in October 2014");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }
                }

                operationalHighlights.Blocks.Add(CreateContentParagraph("Post Trade Services 2"));

                {
                    NBulletList bulletList = new NBulletList(ENBulletListTemplateType.Bullet);
                    m_RichText.Content.BulletLists.Add(bulletList);

                    {
                        NParagraph par = CreateContentParagraph("Adjusted income for the calendar year 2014 was £389.4 million, up 24 per cent on a pro forma constant currency basis. LCH.Clearnet received EMIR reauthorisation for the UK and France businesses — SwapClear, the world’s leading interest rate swap clearing service, cleared $642 trillion notional, up 26 per cent");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("Compression services at SwapClear reduced level of notional outstanding, from $426 trillion to $362 trillion");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("Our Group was granted clearing house recognition in Canada and Australia");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }
                    {
                        NParagraph par = CreateContentParagraph("Clearing of commodities for the London Metal Exchange ceased in September 2014 as expected");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }
                    {
                        NParagraph par = CreateContentParagraph("RepoClear, one of Europe’s largest fixed income clearers, cleared €73.4 trillion in nominal value, up 1 per cent");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    operationalHighlights.Blocks.Add(CreateContentParagraph("Group Adjusted Total Income by segment"));

                    NTable table = new NTable();
                    table.Margins = new NMargins(10);
                    table.AllowSpacingBetweenCells = false;
                    operationalHighlights.Blocks.Add(table);

                    table.Columns.Add(new NTableColumn());
                    table.Columns.Add(new NTableColumn());
                    table.Columns.Add(new NTableColumn());

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);

                        NTableCell tc1 = CreateTableCellWithBorder();
                        tableRow.Cells.Add(tc1);

                        NTableCell tc2 = CreateTableCellWithBorder();
                        tc2.Blocks.Add(CreateContentParagraph("2013"));
                        tableRow.Cells.Add(tc2);

                        NTableCell tc3 = CreateTableCellWithBorder();
                        tc3.Blocks.Add(CreateContentParagraph("2014"));
                        tableRow.Cells.Add(tc3);
                    }

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);

                        NTableCell tc1 = CreateTableCellWithBorder();
                        tc1.Blocks.Add(CreateContentParagraph("Capital Markets"));
                        tableRow.Cells.Add(tc1);

                        NTableCell tc2 = CreateTableCellWithBorder();
                        tc2.Blocks.Add(CreateContentParagraph("249.1"));
                        tableRow.Cells.Add(tc2);

                        NTableCell tc3 = CreateTableCellWithBorder();
                        tc3.Blocks.Add(CreateContentParagraph("333.2"));
                        tableRow.Cells.Add(tc3);
                    }

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);

                        NTableCell tc1 = CreateTableCellWithBorder();
                        tc1.Blocks.Add(CreateContentParagraph("Post Trade Service"));
                        tableRow.Cells.Add(tc1);

                        NTableCell tc2 = CreateTableCellWithBorder();
                        tc2.Blocks.Add(CreateContentParagraph("94.7"));
                        tableRow.Cells.Add(tc2);

                        NTableCell tc3 = CreateTableCellWithBorder();
                        tc3.Blocks.Add(CreateContentParagraph("129.1"));
                        tableRow.Cells.Add(tc3);
                    }

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);

                        NTableCell tc1 = CreateTableCellWithBorder();
                        tc1.Blocks.Add(CreateContentParagraph("Information Services "));
                        tableRow.Cells.Add(tc1);

                        NTableCell tc2 = CreateTableCellWithBorder();
                        tc2.Blocks.Add(CreateContentParagraph("281.0"));
                        tableRow.Cells.Add(tc2);

                        NTableCell tc3 = CreateTableCellWithBorder();
                        tc3.Blocks.Add(CreateContentParagraph("373.0"));
                        tableRow.Cells.Add(tc3);
                    }

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);

                        NTableCell tc1 = CreateTableCellWithBorder();
                        tc1.Blocks.Add(CreateContentParagraph("Technology Services"));
                        tableRow.Cells.Add(tc1);

                        NTableCell tc2 = CreateTableCellWithBorder();
                        tc2.Blocks.Add(CreateContentParagraph("47.3"));
                        tableRow.Cells.Add(tc2);

                        NTableCell tc3 = CreateTableCellWithBorder();
                        tc3.Blocks.Add(CreateContentParagraph("66.0"));
                        tableRow.Cells.Add(tc3);
                    }

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);

                        NTableCell tc1 = CreateTableCellWithBorder();
                        tc1.Blocks.Add(CreateContentParagraph("Other"));
                        tableRow.Cells.Add(tc1);

                        NTableCell tc2 = CreateTableCellWithBorder();
                        tc2.Blocks.Add(CreateContentParagraph("87.2"));
                        tableRow.Cells.Add(tc2);

                        NTableCell tc3 = CreateTableCellWithBorder();
                        tc3.Blocks.Add(CreateContentParagraph("90.4"));
                        tableRow.Cells.Add(tc3);
                    }
                }
            }
        }