public GraphicsState Save() { var currentState = new GraphicsState(this); restoreStack.Push(currentState); return currentState; }
public void Restore(GraphicsState state) { var restoreState = restoreStack.Pop(); if (state != restoreState) { throw new Exception("UG.Graphics Restore state match failure"); } restoreState.Restore(); }