Esempio n. 1
0
        public int Restore(InternalGraphicsState state)
        {
            if (!_stack.Contains(state))
            {
                throw new ArgumentException("State not on stack.", "state");
            }
            if (state.Invalid)
            {
                throw new ArgumentException("State already restored.", "state");
            }

            int count = 1;
            InternalGraphicsState top = _stack.Pop();

            top.Popped();
            while (top != state)
            {
                count++;
                state.Invalid = true;
                top           = _stack.Pop();
                top.Popped();
            }
            state.Invalid = true;
            return(count);
        }
Esempio n. 2
0
 public void Push(InternalGraphicsState state)
 {
     _stack.Push(state);
     state.Pushed();
 }
Esempio n. 3
0
 public GraphicsStateStack(XGraphics gfx)
 {
     _current = new InternalGraphicsState(gfx);
 }