コード例 #1
0
        public IScenario SetScenario(string scenarioTag)
        {
            CurrentScope?.Dispose();
            CurrentScope = null;

            var scenario = _container.CurrentContainer.ResolveKeyed <IScenario>(scenarioTag);

            Scenario = scenario;

            var scope = _container.CurrentContainer.BeginLifetimeScope(scenario.Info.Symbol, builder =>
            {
                scenario.Register(builder);
            });

            _container.CurrentScope = scope;

            return(Scenario);
        }
コード例 #2
0
 public static void BeginNewLifetimeScope()
 {
     CurrentScope.Dispose();
     CurrentScope = _lifetime.BeginLifetimeScope();
 }
コード例 #3
0
 public void Dispose()
 {
     CurrentScope?.Dispose();
 }
コード例 #4
0
ファイル: CompositionRoot.cs プロジェクト: nexdome/ASCOM
 public static void EndSessionScope()
 {
     Log.Info().Message("Ending session scope {scope}", CurrentScope).Write();
     CurrentScope?.Dispose();
     CurrentScope = null;
 }