void InitReadContentAsType( string methodName ) {
switch ( state ) {
case State.Initial:
case State.EndOfFile:
case State.Closed:
case State.Error:
break;
case State.Interactive:
return;
case State.PopNamespaceScope:
case State.ClearNsAttributes:
// no need to clean ns attributes or pop scope because the reader when ReadContentAs is called
// - on Element errors
// - on Attribute does not move
// - on EndElement does not move
// and that's all where State.ClearNsAttributes or State.PopNamespacScope can be set
return;
case State.ReadElementContentAsBase64:
case State.ReadElementContentAsBinHex:
case State.ReadContentAsBase64:
case State.ReadContentAsBinHex:
throw new InvalidOperationException( Res.GetString( Res.Xml_MixingReadValueChunkWithBinary ) );
default:
Debug.Assert( false );
break;
}
throw CreateReadContentAsException( methodName );
}