Castle.DynamicProxy.Contributors.InterfaceProxyWithoutTargetContributor.GetInvocationType C# (CSharp) Method

GetInvocationType() private method

private GetInvocationType ( MetaMethod method, ClassEmitter emitter, ProxyGenerationOptions options ) : Type
method MetaMethod
emitter Castle.DynamicProxy.Generators.Emitters.ClassEmitter
options ProxyGenerationOptions
return System.Type
		private Type GetInvocationType(MetaMethod method, ClassEmitter emitter, ProxyGenerationOptions options)
		{
			var scope = emitter.ModuleScope;
			var key = new CacheKey(method.Method, CompositionInvocationTypeGenerator.BaseType, null, null);

			// no locking required as we're already within a lock
			var invocation = scope.GetFromCache(key);
			if (invocation != null)
			{
				return invocation;
			}

			invocation = new CompositionInvocationTypeGenerator(method.Method.DeclaringType,
			                                                    method,
			                                                    method.Method,
			                                                    false,
			                                                    null)
				.Generate(emitter, options, namingScope)
				.BuildType();

			scope.RegisterInCache(key, invocation);

			return invocation;
		}
	}