コード例 #1
0
ファイル: PropertyInjectionCall.cs プロジェクト: xerxesb/Hiro
 /// <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))
 {
 }
コード例 #2
0
ファイル: PropertyInjectionCall.cs プロジェクト: xerxesb/Hiro
 /// <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;
 }
コード例 #3
0
 /// <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))
 {
 }
コード例 #4
0
 /// <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;
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instances of the <see cref="CachedInstantiation"/> class.
 /// </summary>
 /// <param name="actualImplementation"></param>
 public CachedInstantiation(IStaticImplementation actualImplementation)
 {
     _actualImplementation = actualImplementation;
 }
コード例 #6
0
 /// <summary>
 /// Initializes a new instances of the <see cref="CachedInstantiation"/> class.
 /// </summary>
 /// <param name="actualImplementation"></param>
 public CachedInstantiation(IStaticImplementation actualImplementation)
 {
     _actualImplementation = actualImplementation;
 }
コード例 #7
0
ファイル: SingletonType.cs プロジェクト: tralivali1234/Hiro
 /// <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;
 }
コード例 #8
0
ファイル: SingletonType.cs プロジェクト: xerxesb/Hiro
 /// <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;
 }
コード例 #9
0
        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))
        {
        }