Esempio n. 1
0
        public void CreateBullitList()
        {
            //Add the same list but then as a bullet list
            var bulletList = _document.AddBulletList();

            bulletList.AddItem(0, "Bullet Item 1");
            bulletList.AddItem(0, "Bullet Item 2");
            bulletList.AddItem(1, "Bullet Item 2a");
            bulletList.AddItem(2, "Bullet Item 2aa");
            bulletList.AddItem(0, "Bullet Item 3");

            var list  = _document.Paragraphs[0] as BulletList;
            var item1 = list.Items[0];
            var item2 = list.Items[1];
            var item3 = list.Items[2];
            var item4 = list.Items[3];
            var item5 = list.Items[4];

            Assert.True(_document.Paragraphs.Count == 1, "List not added to document");
            Assert.True(list.Items.Count == 5, "Not the correct number of items in the list");
            Assert.True(item1.Text == "Bullet Item 1", "Text of item 1 in the list is not correct");
            Assert.True(item1.Level == 0, "Level of item 1 in the list is not correct");
            Assert.True(item2.Text == "Bullet Item 2", "Text of item 2 in the list is not correct");
            Assert.True(item2.Level == 0, "Level of item 2 in the list is not correct");
            Assert.True(item3.Text == "Bullet Item 2a", "Text of item 3 in the list is not correct");
            Assert.True(item3.Level == 1, "Level of item 3 in the list is not correct");
            Assert.True(item4.Text == "Bullet Item 2aa", "Text of item 4 in the list is not correct");
            Assert.True(item4.Level == 2, "Level of item 4 in the list is not correct");
            Assert.True(item5.Text == "Bullet Item 3", "Text of item 5 in the list is not correct");
            Assert.True(item5.Level == 0, "Level of item 5 in the list is not correct");
        }
Esempio n. 2
0
        private BulletList AddBulletListFromLevel1(TextDocument document, string name)
        {
            //Add the same list but then as a bullet list
            var bulletList = document.AddBulletList();

            bulletList.AddItem(1, "Most popular sonnets:");
            bulletList.AddItem(2, "Sonnet 126 O thou my lovely boy");
            bulletList.AddItem(3, "O thou my lovely boy");
            bulletList.AddItem(2, "Sonnet 130");
            bulletList.AddItem(3, "My Mistress' eyes");
            bulletList.AddItem(2, "Sonnet 029");
            bulletList.AddItem(3, "When in disgrace with fortune");
            bulletList.AddItem(2, "Sonnet 116");
            bulletList.AddItem(3, "Let me not to the marriage of true minds");
            bulletList.AddItem(2, "Sonnet 18");
            bulletList.AddItem(3, "Shall I compare thee to a Summer's day? ");

            return(bulletList);
        }