本文整理汇总了C#中IBlock.Reflow方法的典型用法代码示例。如果您正苦于以下问题:C# IBlock.Reflow方法的具体用法?C# IBlock.Reflow怎么用?C# IBlock.Reflow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IBlock
的用法示例。
在下文中一共展示了IBlock.Reflow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Reflow
public Size Reflow(DrawContext dc, XmlElement e)
{
PerfLog.Mark();
Style s=Stylesheet.GetStyle(dc.Graphics, e, dc.DocumentType.GetElementType(e));
rootBlock=s.CreateReflowObject(null, e) as IBlock;
if ( rootBlock == null )
// TODO: M: exception handling
throw new ArgumentException("Invalid stylesheet / document. Root element must be a block.");
BoundingContext bounds=new BoundingContext(dc.BoundingRectangle);
Console.WriteLine("Root block reflow {0}", bounds);
rootBlock.Reflow(dc, bounds, false);
PerfLog.Write("Reflow complete for '{0}'", e.Name);
return new Size(rootBlock.Width, rootBlock.Height);
}
示例2: Draw
public void Draw(DrawContext dc, XmlElement e)
{
Style c=Stylesheet.GetStyle(dc.Graphics, e, dc.DocumentType.GetElementType(e));
if ( rootBlock == null )
{
rootBlock=c.CreateReflowObject(null, e) as IBlock;
rootBlock.Reflow(dc, new BoundingContext(dc.BoundingRectangle), false);
}
if ( rootBlock == null )
throw new InvalidOperationException("Root element is not a block element");
// PerfLog.Mark();
rootBlock.Draw(dc, 0, 0, c);
// PerfLog.Write("Layout engine redraw complete for rect bounds {0} / clip {1}", dc.BoundingRectangle, dc.ClippingRectangle);
}