/// <summary> /// Push a copy of the current state set onto the stack. /// </summary> public void Push() { if (IsDisposed) { throw new ObjectDisposedException("GraphicsStateSetStack"); } GraphicsStateSet currentStateSetCopy = Current.Push(); // Avoid a disposition of this state set currentStateSetCopy.IncRef(); // Set the copy as the current state set _StateSetStack.AddLast(currentStateSetCopy); }