Beispiel #1
0
        private void HandleNullContextError(ContainerRegistry containerRegistry)
        {
            var message = $"ContainerRegistry {containerRegistry} has null context!";

            switch (NullContextReaction)
            {
            case LifeTimeReaction.NoReaction:
                break;

            case LifeTimeReaction.LogError:
                Log.Error(Tag, message);
                break;

            case LifeTimeReaction.ThrowException:
                throw new LifeTimeException(message);
            }
        }
Beispiel #2
0
        private void HandleContextLifeTimeError(ContainerRegistry parentRegistry, ContainerRegistry childRegistry)
        {
            var message = $"Parent ContainerRegistry {parentRegistry} has context with lifetime {parentRegistry.Context.Lifetime}" +
                          $" less or equal than child ContainerRegistry {childRegistry} with context lifetime {childRegistry.Context.Lifetime}";

            switch (LifeTimeErrorReaction)
            {
            case LifeTimeReaction.NoReaction:
                break;

            case LifeTimeReaction.LogError:
                Log.Error(Tag, message);
                break;

            case LifeTimeReaction.ThrowException:
                throw new LifeTimeException(message);
            }
        }
Beispiel #3
0
        public void Push(ContainerRegistry containerRegistry)
        {
            _stack.Add(containerRegistry);

            CheckLifeTime();
        }
Beispiel #4
0
 internal void AddRegistry(ContainerRegistry registry)
 {
     _containerRegistries.Add(registry);
 }