Exemplo n.º 1
0
        public override object CreateOrGetInstance(object[] args)
        {
            object instance = this.Factory.CreateInstance(this.Type, args);

            InstanceCreatedEventArgs arg = new InstanceCreatedEventArgs();

            arg.Instance     = instance;
            arg.InstanceType = this.Type;

            OnInstanceCreated(arg);

            return(instance);
        }
Exemplo n.º 2
0
        public override object CreateOrGetInstance(object[] args)
        {
            if (this.Instance == null)
            {
                lock (_instancelock)
                {
                    if (this.Instance == null)
                    {
                        this.Instance = this.Factory.CreateInstance(this.Type, args);

                        InstanceCreatedEventArgs arg = new InstanceCreatedEventArgs();
                        arg.Instance     = this.Instance;
                        arg.InstanceType = this.Type;

                        OnInstanceCreated(arg);
                    }
                }
            }

            return(this.Instance);
        }
Exemplo n.º 3
0
 protected virtual void OnInstanceCreated(InstanceCreatedEventArgs e)
 {
     this.InjectionStrategy.ChainAutoInjectors().Inject(e.Instance);
 }