public static IDisposable Using(IMsLifetimeScope newLifetimeScope)
        {
            var previous = Current;

            Current = newLifetimeScope;
            return(new DisposeAction(() =>
            {
                Current = previous;
            }));
        }
        public WindsorServiceScope(IWindsorContainer container, IMsLifetimeScope currentMsLifetimeScope)
        {
            _parentLifetimeScope = currentMsLifetimeScope;

            LifetimeScope = new MsLifetimeScope(container);

            _parentLifetimeScope?.AddChild(LifetimeScope);

            _msLifetimeScopeDisposable = MsLifetimeScope.Using(LifetimeScope);
            ServiceProvider            = container.Resolve <IServiceProvider>();
        }
 public WindsorServiceScopeFactory(IWindsorContainer container, MsLifetimeScopeProvider msLifetimeScopeProvider)
 {
     _container       = container;
     _msLifetimeScope = msLifetimeScopeProvider.LifetimeScope;
 }
Example #4
0
 public MsLifetimeScopeProvider()
 {
     LifetimeScope = MsLifetimeScope.Current;
 }
 public ScopedWindsorServiceProvider(IWindsorContainer container, MsLifetimeScopeProvider msLifetimeScopeProvider)
 {
     _container          = container;
     _ownMsLifetimeScope = msLifetimeScopeProvider.LifetimeScope;
 }