System\Xml\Schema\XmlSchemaValidator.cs (45)
87private ValidatorState _currentState;
214_currentState = ValidatorState.None;
365if (_currentState != ValidatorState.None && _currentState != ValidatorState.Finish)
367throw new InvalidOperationException(SR.Format(SR.Sch_InvalidStateTransition, new string[] { s_methodNames[(int)_currentState], s_methodNames[(int)ValidatorState.Start] }));
369_currentState = ValidatorState.Start;
375if (_currentState != ValidatorState.None && _currentState != ValidatorState.Finish)
377throw new InvalidOperationException(SR.Format(SR.Sch_InvalidStateTransition, new string[] { s_methodNames[(int)_currentState], s_methodNames[(int)ValidatorState.Start] }));
384_currentState = ValidatorState.Start;
401CheckStateTransition(ValidatorState.Element, s_methodNames[(int)ValidatorState.Element]);
498ValidatorState toState = _validationStack.Length > 1 ? ValidatorState.Attribute : ValidatorState.TopLevelAttribute;
525XmlSchemaObject? pvtAttribute = _currentState == ValidatorState.TopLevelAttribute ? _partialValidationType : null;
586Debug.Assert(_currentState == ValidatorState.TopLevelAttribute); //Re-set state back to start on error with partial validation type
587_currentState = ValidatorState.Start;
705CheckStateTransition(ValidatorState.Attribute, "GetUnspecifiedDefaultAttributes");
711CheckStateTransition(ValidatorState.EndOfAttributes, s_methodNames[(int)ValidatorState.EndOfAttributes]);
741ValidatorState toState = _validationStack.Length > 1 ? ValidatorState.Text : ValidatorState.TopLevelTextOrWS;
820ValidatorState toState = _validationStack.Length > 1 ? ValidatorState.Whitespace : ValidatorState.TopLevelTextOrWS;
889throw new InvalidOperationException(SR.Format(SR.Sch_InvalidEndElementMultiple, s_methodNames[(int)ValidatorState.SkipToEndElement]));
892CheckStateTransition(ValidatorState.SkipToEndElement, s_methodNames[(int)ValidatorState.SkipToEndElement]);
914_currentState = ValidatorState.SkipToEndElement;
924CheckStateTransition(ValidatorState.Finish, s_methodNames[(int)ValidatorState.Finish]);
930if (_currentState == ValidatorState.Start || _currentState == ValidatorState.TopLevelTextOrWS)
976if (_currentState == ValidatorState.Element || _currentState == ValidatorState.Attribute)
997else if (_currentState == ValidatorState.Start)
1019_currentState = ValidatorState.Attribute;
1171throw new InvalidOperationException(SR.Format(SR.Sch_InvalidEndElementMultiple, s_methodNames[(int)ValidatorState.EndElement]));
1174CheckStateTransition(ValidatorState.EndElement, s_methodNames[(int)ValidatorState.EndElement]);
2072private void CheckStateTransition(ValidatorState toState, string methodName)
2076if (_currentState == ValidatorState.None)
2078throw new InvalidOperationException(SR.Format(SR.Sch_InvalidStartTransition, new string[] { methodName, s_methodNames[(int)ValidatorState.Start] }));