コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #3
0
        public void Push(ContainerRegistry containerRegistry)
        {
            _stack.Add(containerRegistry);

            CheckLifeTime();
        }
コード例 #4
0
 internal void AddRegistry(ContainerRegistry registry)
 {
     _containerRegistries.Add(registry);
 }