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); }
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); }
protected virtual void OnInstanceCreated(InstanceCreatedEventArgs e) { this.InjectionStrategy.ChainAutoInjectors().Inject(e.Instance); }