Antlr4.StringTemplate.TemplateGroup.RegisterTypeProxyFactory C# (CSharp) Method

RegisterTypeProxyFactory() public method

public RegisterTypeProxyFactory ( System.Type targetType, ITypeProxyFactory factory ) : void
targetType System.Type
factory ITypeProxyFactory
return void
        public virtual void RegisterTypeProxyFactory(Type targetType, ITypeProxyFactory factory)
        {
            _proxyFactories = _proxyFactories ?? new TypeRegistry<ITypeProxyFactory>();
            _proxyFactories[targetType] = factory;
        }

Usage Example

Example #1
0
        private static TemplateGroup GetListRendererTemplateGroup()
        {
            if (_listRendererTemplateGroup == null)
            {
                _listRendererTemplateGroup = new TemplateGroupString("AttributeRendererTemplates", Properties.Resources.AttributeRendererTemplates);
                _listRendererTemplateGroup.RegisterRenderer(typeof(IEnumerable), new CollectionRenderer());
                _listRendererTemplateGroup.RegisterTypeProxyFactory(typeof(IDictionary), new DictionaryTypeProxyFactory());
                _listRendererTemplateGroup.RegisterTypeProxyFactory(typeof(Misc.Aggregate), new AggregateProxyFactory());
                _listRendererTemplateGroup.RegisterTypeProxyFactory(typeof(Template), new TemplateProxyFactory(_listRendererTemplateGroup));
            }

            return _listRendererTemplateGroup;
        }