本文整理匯總了C#中Antlr.StringTemplate.StringTemplateGroup.SetTemplateWriterType方法的典型用法代碼示例。如果您正苦於以下問題:C# Antlr.StringTemplate.StringTemplateGroup.SetTemplateWriterType方法的具體用法?C# Antlr.StringTemplate.StringTemplateGroup.SetTemplateWriterType怎麽用?C# Antlr.StringTemplate.StringTemplateGroup.SetTemplateWriterType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Antlr.StringTemplate.StringTemplateGroup
的用法示例。
在下文中一共展示了Antlr.StringTemplate.StringTemplateGroup.SetTemplateWriterType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Initialize
public void Initialize()
{
config = STViewEngineConfiguration.GetConfig(ConfigConstants.ELEMENT_stview_sectionname);
StringTemplateGroup componentGroup = new ViewComponentStringTemplateGroup(
ConfigConstants.STGROUP_NAME_PREFIX + "_components",
config.TemplateLexerType);
StringTemplateGroup helpersSTGroup = new BasicStringTemplateGroup(
ConfigConstants.STGROUP_NAME_PREFIX + "_helpersST",
new EmbeddedResourceTemplateLoader(this.GetType().Assembly, ConfigConstants.HELPER_RESOURCE_NAMESPACE, false),
config.TemplateLexerType);
helpersSTGroup.SuperGroup = componentGroup;
templateGroup = new BasicStringTemplateGroup(
ConfigConstants.STGROUP_NAME_PREFIX,
new FileSystemTemplateLoader(ViewSourceLoader.ViewRootDir, false),
config.TemplateLexerType);
templateGroup.SuperGroup = helpersSTGroup;
if (config.TemplateWriterTypeName != null)
{
componentGroup.SetTemplateWriterType(config.TemplateWriterType);
helpersSTGroup.SetTemplateWriterType(config.TemplateWriterType);
templateGroup.SetTemplateWriterType(config.TemplateWriterType);
}
IEnumerator globalRenderersEnumerator = config.GetGlobalAttributeRenderers();
while (globalRenderersEnumerator.MoveNext())
{
RendererInfo renderInfo = (RendererInfo)globalRenderersEnumerator.Current;
componentGroup.RegisterAttributeRenderer(renderInfo.AttributeType, renderInfo.GetRendererInstance());
helpersSTGroup.RegisterAttributeRenderer(renderInfo.AttributeType, renderInfo.GetRendererInstance());
templateGroup.RegisterAttributeRenderer(renderInfo.AttributeType, renderInfo.GetRendererInstance());
}
}