private Type GetInvocationType(MetaMethod method, ClassEmitter emitter, ProxyGenerationOptions options) { ModuleScope scope = emitter.ModuleScope; CacheKey key = new CacheKey(method.Method, WCFCompositionInvocationTypeGenerator.BaseType, null, null); Type invocation = scope.GetFromCache(key); if (invocation == null) { invocation = new WCFCompositionInvocationTypeGenerator(method.Method.DeclaringType, method, method.Method, false, null).Generate(emitter, options, base.namingScope).BuildType(); scope.RegisterInCache(key, invocation); } return invocation; }
private Type GetInvocationType(MetaMethod method, ClassEmitter @class, ProxyGenerationOptions options) { Type[] invocationInterfaces; ModuleScope scope = @class.ModuleScope; if (this.canChangeTarget) { invocationInterfaces = new Type[] { typeof(IInvocation), typeof(IChangeProxyTarget) }; } else { invocationInterfaces = new Type[] { typeof(IInvocation) }; } CacheKey key = new CacheKey(method.Method, WCFCompositionInvocationTypeGenerator.BaseType, invocationInterfaces, null); Type invocation = scope.GetFromCache(key); if (invocation == null) { invocation = new WCFCompositionInvocationTypeGenerator(method.Method.DeclaringType, method, method.Method, this.canChangeTarget, null).Generate(@class, options, base.namingScope).BuildType(); scope.RegisterInCache(key, invocation); } return invocation; }