public void Run(IOperationContext operationContext, IResourceStore resourceStore) { var currentStackSize = operationContext.StackSize; if (currentStackSize > 1) { operationContext.PopState(); } else { throw new InvalidOperationException("Cannot execute a pop of the graphics state stack, it would leave the stack empty."); } }