public void TestDocument()
        {
            var doc = new Scriber.Document();
            var p   = new Paragraph();

            doc.Elements.Add(p);
            Assert.False(RootPseudo.Matches(p));
            Assert.True(RootPseudo.Matches(doc));
        }
Esempio n. 2
0
        public void TestLocalContainer()
        {
            var doc  = new Scriber.Document();
            var text = new TextLeaf("text")
            {
                Document = doc,
            };

            text.Style.Set(StyleKeys.FontSize, Unit.FromPoint(20));
            var fontSize = text.Style.Get(StyleKeys.FontSize);

            Assert.Equal(20, fontSize.Point);
        }
Esempio n. 3
0
        public void TestParentContainer()
        {
            var doc = new Scriber.Document();

            Assert.True(StyleKeys.FontSize.Inherited);
            doc.Style.Set(StyleKeys.FontSize, Unit.FromPoint(20));
            var text = new TextLeaf("text")
            {
                Document = doc
            };

            text.Parent = doc;
            var fontSize = text.Style.Get(StyleKeys.FontSize);

            Assert.Equal(20, fontSize.Point);
        }
Esempio n. 4
0
        public void TestClassContainer()
        {
            var doc       = new Scriber.Document();
            var spanStyle = new StyleContainer(".class");

            doc.Styles.Add(spanStyle);
            var text = new TextLeaf("text")
            {
                Document = doc
            };

            text.Classes.Add("class");
            spanStyle.Set(StyleKeys.FontSize, Unit.FromPoint(20));
            var fontSize = text.Style.Get(StyleKeys.FontSize);

            Assert.Equal(20, fontSize.Point);
        }
Esempio n. 5
0
 public override void Manipulate(Scriber.Document document)
 {
     Callback(this);
 }
Esempio n. 6
0
 public abstract void Manipulate(Scriber.Document document);