本文整理汇总了C#中HtmlRenderer.Dom.CssBox.SetBeforeBox方法的典型用法代码示例。如果您正苦于以下问题:C# CssBox.SetBeforeBox方法的具体用法?C# CssBox.SetBeforeBox怎么用?C# CssBox.SetBeforeBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlRenderer.Dom.CssBox
的用法示例。
在下文中一共展示了CssBox.SetBeforeBox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateBox
/// <summary>
/// Create new css box for the given parent with the given optional html tag and insert it either
/// at the end or before the given optional box.<br/>
/// If no html tag is given the box will be anonymous.<br/>
/// If no before box is given the new box will be added at the end of parent boxes collection.<br/>
/// If before box doesn't exists in parent box exception is thrown.<br/>
/// </summary>
/// <remarks>
/// To learn more about anonymous inline boxes visit: http://www.w3.org/TR/CSS21/visuren.html#anonymous
/// </remarks>
/// <param name="parent">the box to add the new box to it as child</param>
/// <param name="tag">optional: the html tag to define the box</param>
/// <param name="before">optional: to insert as specific location in parent box</param>
/// <returns>the new box</returns>
public static CssBox CreateBox(CssBox parent, HtmlTag tag = null, CssBox before = null)
{
ArgChecker.AssertArgNotNull(parent, "parent");
var newBox = new CssBox(parent, tag);
newBox.InheritStyle();
if (before != null)
{
newBox.SetBeforeBox(before);
}
return newBox;
}