/// <summary> /// Initializes a new instance of the PropertyInjector class. /// </summary> /// <param name="implementation">The target implementation that will instantiate the service type.</param> public PropertyInjectionCall(IStaticImplementation implementation) : this(implementation, p => p.CanWrite, p => new Dependency(p.PropertyType)) { }
/// <summary> /// Initializes a new instance of the PropertyInjector class. /// </summary> /// <param name="implementation">The target implementation that will instantiate the service type.</param> /// <param name="propertyFilter">The functor that determines which properties will be injected.</param> /// <param name="propertyDependencyResolver">The functor that determines the dependencies that will be injected into each property.</param> public PropertyInjectionCall(IStaticImplementation implementation, Func<PropertyInfo, bool> propertyFilter, Func<PropertyInfo, IDependency> propertyDependencyResolver) { _implementation = implementation; _propertyFilter = propertyFilter; _propertyDependencyResolver = propertyDependencyResolver; }
/// <summary> /// Initializes a new instance of the PropertyInjector class. /// </summary> /// <param name="implementation">The target implementation that will instantiate the service type.</param> /// <param name="propertyFilter">The functor that determines which properties will be injected.</param> /// <param name="propertyDependencyResolver">The functor that determines the dependencies that will be injected into each property.</param> public PropertyInjectionCall(IStaticImplementation implementation, Func <PropertyInfo, bool> propertyFilter, Func <PropertyInfo, IDependency> propertyDependencyResolver) { _implementation = implementation; _propertyFilter = propertyFilter; _propertyDependencyResolver = propertyDependencyResolver; }
/// <summary> /// Initializes a new instances of the <see cref="CachedInstantiation"/> class. /// </summary> /// <param name="actualImplementation"></param> public CachedInstantiation(IStaticImplementation actualImplementation) { _actualImplementation = actualImplementation; }
/// <summary> /// Initializes a new instance of the SingletonType class. /// </summary> /// <param name="singletonEmitter">The emitter that will be responsible for instantiating the singleton implementation.</param> /// <param name="implementation">The implementation that will be used to emitting a service instance.</param> public SingletonType(IStaticImplementation implementation, ISingletonEmitter singletonEmitter) { _implementation = implementation; _emitter = singletonEmitter; }
private static Func<PropertyInfo, bool> defaultPropertyFilter = p => p.CanWrite && p.PropertyType!=typeof(string) && !p.PropertyType.IsValueType; // && p.PropertyType.IsClass; #endregion Fields #region Constructors //HACK removed simple types and strings from injectable services /// <summary> /// Initializes a new instance of the PropertyInjector class. /// </summary> /// <param name="implementation">The target implementation that will instantiate the service type.</param> public PropertyInjectionCall(IStaticImplementation implementation) : this(implementation, defaultPropertyFilter, p => new Dependency(p.PropertyType)) { }