/// <summary> /// Creates a new instance of the method builder. /// </summary> /// <param name="typeBuilder">The type builder to use.</param> /// <param name="proxyGenerator"> /// The <see cref="IProxyTypeGenerator"/> implementation to use. /// </param> /// <param name="explicitImplementation"> /// <see langword="true"/> if the interface is to be /// implemented explicitly; otherwise <see langword="false"/>. /// </param> public AbstractProxyMethodBuilder(TypeBuilder typeBuilder, IProxyTypeGenerator proxyGenerator, bool explicitImplementation) { this.typeBuilder = typeBuilder; this.proxyGenerator = proxyGenerator; this.explicitImplementation = explicitImplementation; }
/// <summary> /// Initializes a new instance of a SupportsWebDependencyInjectionMethodBuilder /// </summary> public SupportsWebDependencyInjectionMethodBuilder(TypeBuilder typeBuilder, IProxyTypeGenerator proxyGenerator, FieldInfo appContextField, MethodInfo callbackMethod) : base(typeBuilder, proxyGenerator, true) { _appContextField = appContextField; _callbackMethod = callbackMethod; }
public ServiceTable(IAspectConfiguration configuration) { var aspectValidatorBuilder = new AspectValidatorBuilder(configuration); _proxyTypeGenerator = new ProxyTypeGenerator(aspectValidatorBuilder); _serviceValidator = new ServiceValidator(aspectValidatorBuilder); _linkedServiceDefinitions = new ConcurrentDictionary <Type, LinkedList <ServiceDefinition> >(); _linkedGenericServiceDefinitions = new ConcurrentDictionary <Type, LinkedList <ServiceDefinition> >(); }
public ProxyProvider(IProxyConfiguration configuration, IProxyCollection collection, IProxyTypeGenerator typeGenerator, IProxyValidator validator) { _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); _collection = collection ?? throw new ArgumentNullException(nameof(collection)); _generator = typeGenerator ?? throw new ArgumentNullException(nameof(typeGenerator)); _validator = validator ?? throw new ArgumentNullException(nameof(validator)); }
public IProxyFlare Use(IProxyTypeGeneratorFactory typeGeneratorFactory) { if (typeGeneratorFactory == null) { throw new ArgumentNullException(nameof(typeGeneratorFactory)); } _typeGenerator = typeGeneratorFactory.BuilderTypeGenerator(_configuration); return(this); }
/// <summary> /// Creates a new instance of the method builder. /// </summary> /// <param name="typeBuilder">The type builder to use.</param> /// <param name="proxyGenerator"> /// The <see cref="IProxyTypeGenerator"/> implementation to use. /// </param> /// <param name="explicitImplementation"> /// <see langword="true"/> if the interface is to be /// implemented explicitly; otherwise <see langword="false"/>. /// </param> public TargetProxyMethodBuilder( TypeBuilder typeBuilder, IProxyTypeGenerator proxyGenerator, bool explicitImplementation) : base(typeBuilder, proxyGenerator, explicitImplementation) { }
/// <summary> /// Creates a new instance of the method builder. /// </summary> /// <param name="typeBuilder">The type builder to use.</param> /// <param name="proxyGenerator"> /// The <see cref="IProxyTypeGenerator"/> implementation to use. /// </param> public SoapHttpClientProxyMethodBuilder( TypeBuilder typeBuilder, IProxyTypeGenerator proxyGenerator) : base(typeBuilder, proxyGenerator, false) { }
private static ServiceDescriptor MakeProxyService(ServiceDescriptor descriptor, Type implementationType, IProxyTypeGenerator proxyTypeGenerator) { var serviceTypeInfo = descriptor.ServiceType.GetTypeInfo(); if (serviceTypeInfo.IsClass) { return(ServiceDescriptor.Describe( descriptor.ServiceType, proxyTypeGenerator.CreateClassProxyType(descriptor.ServiceType, implementationType), descriptor.Lifetime)); } else if (serviceTypeInfo.IsGenericTypeDefinition) { return(ServiceDescriptor.Describe( descriptor.ServiceType, proxyTypeGenerator.CreateClassProxyType(implementationType, implementationType), descriptor.Lifetime)); } else { var proxyType = proxyTypeGenerator.CreateInterfaceProxyType(descriptor.ServiceType, implementationType); return(ServiceDescriptor.Describe( descriptor.ServiceType, CreateFactory(descriptor, proxyType), descriptor.Lifetime)); } }
public WcfMethodBuilder(TypeBuilder builder, IProxyTypeGenerator generator, Type channelManager) : base(builder, generator, false) { InvokeMethod = channelManager.GetMethod(ExecuteMethodName, BindingFlags.NonPublic | BindingFlags.Instance); }
public ServicedComponentTargetProxyMethodBuilder(TypeBuilder typeBuilder, IProxyTypeGenerator proxyGenerator, bool explicitImplementation) : base(typeBuilder, proxyGenerator, explicitImplementation) { }
public ProxyGenerator(IProxyTypeGenerator proxyTypeGenerator, IAspectActivatorFactory aspectActivatorFactory) { _proxyTypeGenerator = proxyTypeGenerator ?? throw new ArgumentNullException(nameof(proxyTypeGenerator)); _aspectActivatorFactory = aspectActivatorFactory ?? throw new ArgumentNullException(nameof(aspectActivatorFactory)); }
public DynamicProxyBuilder() { _proxyWrapper = new ProxyWrapper <T>(); _proxyTypeGenerator = new ProxyTypeGenerator(); }
public AspectCoreClientProxyCreator(IProxyTypeGenerator generator, IAspectContextFactory contextFactory, ClientProxyAspectBuilderFactory aspectBuilderFactory) { this.generator = generator; this.contextFactory = contextFactory; this.aspectBuilderFactory = aspectBuilderFactory; }
/// <summary> /// Creates a new instance of the method builder. /// </summary> /// <param name="typeBuilder">The type builder to use.</param> /// <param name="proxyGenerator"> /// The <see cref="IProxyTypeGenerator"/> implementation to use. /// </param> /// <param name="explicitImplementation"> /// <see langword="true"/> if the interface is to be /// implemented explicitly; otherwise <see langword="false"/>. /// </param> public BaseProxyMethodBuilder(TypeBuilder typeBuilder, IProxyTypeGenerator proxyGenerator, bool explicitImplementation) : base(typeBuilder, proxyGenerator, explicitImplementation) { }