本文整理汇总了C#中Interpreter.Exec方法的典型用法代码示例。如果您正苦于以下问题:C# Interpreter.Exec方法的具体用法?C# Interpreter.Exec怎么用?C# Interpreter.Exec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interpreter
的用法示例。
在下文中一共展示了Interpreter.Exec方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TemplateVisualizer
internal TemplateVisualizer()
{
InitializeComponent();
StringWriter sw = new StringWriter();
var template = CreateDefaultTemplate();
Interpreter interp = new Interpreter(template.groupThatCreatedThisInstance);
interp.Exec(new AutoIndentWriter(sw), template);
IList<InterpEvent> events = interp.Events;
string text = sw.ToString();
templatesTree.Items.Add(new RootEvent(template, 0, text.Length));
txtOutput.Document = new FlowDocument(new Paragraph(new Run(text)));
}
示例2: GetEvents
public IList<InterpEvent> GetEvents(CultureInfo culture, int lineWidth)
{
StringWriter stream = new StringWriter();
ITemplateWriter writer = new AutoIndentWriter(stream);
writer.SetLineWidth(lineWidth);
Interpreter interp = new Interpreter(groupThatCreatedThisInstance, culture);
interp.Exec(writer, this);
return interp.Events;
}
示例3: Write
public virtual int Write(ITemplateWriter @out, CultureInfo culture)
{
Interpreter interp = new Interpreter(groupThatCreatedThisInstance, culture);
interp.SetDefaultArguments(this);
return interp.Exec(@out, this);
}