本文整理汇总了C#中Tag.AddChild方法的典型用法代码示例。如果您正苦于以下问题:C# Tag.AddChild方法的具体用法?C# Tag.AddChild怎么用?C# Tag.AddChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tag
的用法示例。
在下文中一共展示了Tag.AddChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
virtual public void SetUp() {
parent = new Tag("body");
parent.CSS[CSS.Property.FONT_FAMILY] = "Helvetica";
parent.CSS[CSS.Property.FONT_SIZE] = "12pt";
first = new Tag(null);
first.CSS[CSS.Property.FONT_FAMILY] = "Helvetica";
first.CSS[CSS.Property.FONT_SIZE] = "12pt";
second = new Tag(null);
second.CSS[CSS.Property.FONT_FAMILY] = "Helvetica";
second.CSS[CSS.Property.FONT_SIZE] = "12pt";
child = new Tag(null);
child.CSS[CSS.Property.FONT_FAMILY] = "Helvetica";
child.CSS[CSS.Property.FONT_SIZE] = "12pt";
parent.AddChild(first);
first.Parent = parent;
second.Parent = parent;
first.AddChild(child);
second.AddChild(child);
parent.CSS[CSS.Property.FONT_SIZE] = fst.TranslateFontSize(parent) + "pt";
first.CSS[CSS.Property.FONT_SIZE] = fst.TranslateFontSize(first) + "pt";
first.CSS[CSS.Property.TEXT_ALIGN] = CSS.Value.LEFT;
second.CSS[CSS.Property.FONT_SIZE] = fst.TranslateFontSize(second) + "pt";
child.CSS[CSS.Property.FONT_SIZE] = fst.TranslateFontSize(child) + "pt";
firstPara = new Paragraph(new Chunk("default text for chunk creation"));
secondPara = new Paragraph(new Chunk("default text for chunk creation"));
configuration = new HtmlPipelineContext(null);
applier.Apply(firstPara, first, configuration);
}
示例2: SetUp
virtual public void SetUp() {
LoggerFactory.GetInstance().SetLogger(new SysoLogger(3));
root = new Tag("body");
p = new Tag("p");
ul = new Tag("ul");
first = new Tag("li");
last = new Tag("li");
single = new ListItem("Single");
start = new ListItem("Start");
end = new ListItem("End");
listWithOne = new List<IElement>();
listWithTwo = new List<IElement>();
orderedUnorderedList = new OrderedUnorderedList();
CssAppliersImpl cssAppliers = new CssAppliersImpl();
orderedUnorderedList.SetCssAppliers(cssAppliers);
workerContextImpl = new WorkerContextImpl();
HtmlPipelineContext context2 = new HtmlPipelineContext(cssAppliers);
workerContextImpl.Put(typeof (HtmlPipeline).FullName, context2);
root.AddChild(p);
root.AddChild(ul);
ul.AddChild(first);
ul.AddChild(last);
p.CSS["font-size"] = "12pt";
p.CSS["margin-top"] = "12pt";
p.CSS["margin-bottom"] = "12pt";
new ParagraphCssApplier(cssAppliers).Apply(new Paragraph("paragraph"), p, context2);
first.CSS["margin-top"] = "50pt";
first.CSS["padding-top"] = "25pt";
first.CSS["margin-bottom"] = "50pt";
first.CSS["padding-bottom"] = "25pt";
last.CSS["margin-bottom"] = "50pt";
last.CSS["padding-bottom"] = "25pt";
listWithOne.Add(single);
listWithTwo.Add(start);
listWithTwo.Add(end);
}
示例3: ValidateParentSetOnAdd
virtual public void ValidateParentSetOnAdd() {
Tag t = new Tag("pappie");
Tag t2 = new Tag("baby");
t.AddChild(t2);
Assert.AreEqual(t, t2.Parent);
}