System.Xml.XmlWellFormedWriter.ThrowInvalidStateTransition C# (CSharp) Méthode

ThrowInvalidStateTransition() private méthode

private ThrowInvalidStateTransition ( Token token, State currentState ) : void
token Token
currentState State
Résultat void
        private void ThrowInvalidStateTransition(Token token, State currentState)
        {
            string wrongTokenMessage = SR.Format(SR.Xml_WrongToken, tokenName[(int)token], GetStateName(currentState));
            switch (currentState)
            {
                case State.AfterRootEle:
                case State.Start:
                    if (_conformanceLevel == ConformanceLevel.Document)
                    {
                        throw new InvalidOperationException(wrongTokenMessage + ' ' + SR.Xml_ConformanceLevelFragment);
                    }
                    break;
            }
            throw new InvalidOperationException(wrongTokenMessage);
        }