System\Xml\Schema\XmlSchemaValidator.cs (45)
86private ValidatorState currentState;
205currentState = ValidatorState.None;
337if (currentState != ValidatorState.None && currentState != ValidatorState.Finish) {
338throw new InvalidOperationException(Res.GetString(Res.Sch_InvalidStateTransition, new string[] { MethodNames[(int)currentState], MethodNames[(int)ValidatorState.Start] }));
340currentState = ValidatorState.Start;
345if (currentState != ValidatorState.None && currentState != ValidatorState.Finish) {
346throw new InvalidOperationException(Res.GetString(Res.Sch_InvalidStateTransition, new string[] { MethodNames[(int)currentState], MethodNames[(int)ValidatorState.Start] }));
354currentState = ValidatorState.Start;
377CheckStateTransition(ValidatorState.Element, MethodNames[(int)ValidatorState.Element]);
466ValidatorState toState = validationStack.Length > 1 ? ValidatorState.Attribute : ValidatorState.TopLevelAttribute;
492XmlSchemaObject pvtAttribute = currentState == ValidatorState.TopLevelAttribute ? partialValidationType : null;
545Debug.Assert(currentState == ValidatorState.TopLevelAttribute); //Re-set state back to start on error with partial validation type
546currentState = ValidatorState.Start;
645CheckStateTransition(ValidatorState.Attribute, "GetUnspecifiedDefaultAttributes");
650CheckStateTransition(ValidatorState.EndOfAttributes, MethodNames[(int)ValidatorState.EndOfAttributes]);
677ValidatorState toState = validationStack.Length > 1 ? ValidatorState.Text : ValidatorState.TopLevelTextOrWS;
744ValidatorState toState = validationStack.Length > 1 ? ValidatorState.Whitespace : ValidatorState.TopLevelTextOrWS;
800throw new InvalidOperationException(Res.GetString(Res.Sch_InvalidEndElementMultiple, MethodNames[(int)ValidatorState.SkipToEndElement]));
802CheckStateTransition(ValidatorState.SkipToEndElement, MethodNames[(int)ValidatorState.SkipToEndElement]);
821currentState = ValidatorState.SkipToEndElement;
829CheckStateTransition(ValidatorState.Finish, MethodNames[(int)ValidatorState.Finish]);
834if (currentState == ValidatorState.Start || currentState == ValidatorState.TopLevelTextOrWS) { //Right after initialize
861if (currentState == ValidatorState.Element || currentState == ValidatorState.Attribute) {
876else if (currentState == ValidatorState.Start) {
888currentState = ValidatorState.Attribute;
1008throw new InvalidOperationException(Res.GetString(Res.Sch_InvalidEndElementMultiple, MethodNames[(int)ValidatorState.EndElement]));
1010CheckStateTransition(ValidatorState.EndElement, MethodNames[(int)ValidatorState.EndElement]);
1743private void CheckStateTransition(ValidatorState toState, string methodName) {
1745if (currentState == ValidatorState.None) {
1746throw new InvalidOperationException(Res.GetString(Res.Sch_InvalidStartTransition, new string[] { methodName, MethodNames[(int)ValidatorState.Start] }));