Exemple #1
0
        public Value PushCommand(CallScope args)
        {
            // Make a copy at position 2, because the topmost report object has an
            // open output stream at this point.  We want it to get popped off as
            // soon as this command terminate so that the stream is closed cleanly.
            Report temp = ReportStack.Pop();

            ReportStack.Push(new Report(temp));
            ReportStack.Push(temp);
            return(Value.Get(true));
        }
Exemple #2
0
        public void PopReport()
        {
            if (!ReportStack.Any())
            {
                throw new InvalidOperationException("Stack is empty");
            }
            ReportStack.Pop();

            // There should always be the "default report" waiting on the stack.
            if (!ReportStack.Any())
            {
                throw new InvalidOperationException("Stack is empty");
            }
            Scope.DefaultScope = Report;
        }
Exemple #3
0
        public void PopReport()
        {
            if (!ReportStack.Any())
            {
                throw new InvalidOperationException("Stack is empty");
            }

            ReportStack.Peek().QuickClose(); // DM - this code simulates calling Report's destructor at this moment
            ReportStack.Pop();

            // There should always be the "default report" waiting on the stack.
            if (!ReportStack.Any())
            {
                throw new InvalidOperationException("Stack is empty");
            }
            Scope.DefaultScope = Report;
        }