Beispiel #1
0
        /// <summary>
        /// Remove stack entry
        /// </summary>
        public override void PostBuildUp(ref BuilderContext context)
        {
            var stack = _stackFactory.Get();
            ResolveStackEntry entry;

            if (stack.Peek().ResolveType != context.Type || stack.Peek().ResolveName != context.Name)
            {
                throw new InvalidOperationException("Removing wrong dependency.");
            }

            entry = stack.Pop();

            if (entry.IsBaseResolve)
            {
                if (stack.Count == 0)
                {
                    _stackFactory.Delete();
                }
                else
                {
                    throw new InvalidOperationException("Dependency stack should be empty.");
                }
            }

            base.PostBuildUp(ref context);
        }