Method ThrowInvalidState
ThrowInvalidState(string, params BsonReaderState[])
Throws an InvalidOperationException when the method called is not valid for the current state.
protected void ThrowInvalidState(string methodName, params BsonReaderState[] validStates)
Parameters
methodNamestringThe name of the method.
validStatesBsonReaderState[]The valid states.