本文整理汇总了C#中Builder.AddLayoutLine方法的典型用法代码示例。如果您正苦于以下问题:C# Builder.AddLayoutLine方法的具体用法?C# Builder.AddLayoutLine怎么用?C# Builder.AddLayoutLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Builder
的用法示例。
在下文中一共展示了Builder.AddLayoutLine方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AllLines
/// <summary>
/// Generates a TextViewLayout from all the lines in the model.
/// </summary>
/// <param name="model"></param>
/// <param name="g"></param>
/// <param name="defaultFont"></param>
/// <param name="styleStack"></param>
/// <returns></returns>
public static TextViewLayout AllLines(TextViewModel model, Graphics g, Font defaultFont, StyleStack styleStack)
{
model.MoveToLine(model.StartPosition, 0);
var rcLine = new RectangleF();
var builder = new Builder(model, g, styleStack, defaultFont);
for (;;)
{
var lines = model.GetLineSpans(1);
if (lines.Length == 0)
break;
builder.AddLayoutLine(lines[0], ref rcLine);
}
var layout = builder.Build();
return layout;
}
示例2: VisibleLines
public static TextViewLayout VisibleLines(TextViewModel model, Size size, Graphics g, Font defaultFont, StyleStack styleStack)
{
var szClient = new SizeF(size);
var rcLine = new RectangleF(0, 0, szClient.Width, 0);
var builder = new Builder(model, g, styleStack, defaultFont);
while (rcLine.Top < szClient.Height)
{
var lines = model.GetLineSpans(1);
if (lines.Length == 0)
break;
builder.AddLayoutLine(lines[0], ref rcLine);
}
return builder.Build();
}