Ejemplo n.º 1
0
        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));
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo n.º 5
0
 public override void Manipulate(Scriber.Document document)
 {
     Callback(this);
 }
Ejemplo n.º 6
0
 public abstract void Manipulate(Scriber.Document document);