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)); }
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); }
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); }
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); }
public override void Manipulate(Scriber.Document document) { Callback(this); }
public abstract void Manipulate(Scriber.Document document);