using System; using System.Collections.Generic; using System.Linq; using Castle.DynamicProxy; using Castle.DynamicProxy.Generators.Emitters; using Castle.DynamicProxy.Generators.Emitters.SimpleAST; using Castle.DynamicProxy.Serialization; using Castle.DynamicProxy.Generators; using Castle.DynamicProxy.Contributors; namespace Castle.ExtensibleDynamicProxy { public class ExtensibleClassProxyGenerator : ClassProxyGenerator { public ExtensibleClassProxyGenerator(ModuleScope scope, Type targetType, ExtensibleProxyBuilder proxyBuilder) : base(scope, targetType) { _proxyBuilder = proxyBuilder; } ExtensibleProxyBuilder _proxyBuilder; protected override IEnumerable<Type> GetTypeImplementerMapping(Type[] interfaces, out IEnumerable<ITypeContributor> contributors, INamingScope namingScope) { IEnumerable<ITypeContributor> contr; var ret = base.GetTypeImplementerMapping(interfaces, out contr, namingScope); var list = contr.ToList(); list.AddRange(_proxyBuilder.Contributors); contributors = list; return ret; } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)