svn path=/branches/mono-1-1-9/mcs/; revision=51207
[mono.git] / mcs / class / System.XML / Mono.Xml.Schema / XsdValidatingReader.cs
index 67616cd397cbc1ab5c188984e13820bd0ec3b3bf..4355366e729abcd798ee4662d23eec983cd670ad 100644 (file)
@@ -70,7 +70,6 @@ namespace Mono.Xml.Schema
                ValidationType validationType;
                XmlSchemaSet schemas = new XmlSchemaSet ();
                bool namespaces = true;
-               bool validationStarted;
 
 #region ID Constraints
                bool checkIdentity = true;
@@ -148,7 +147,7 @@ namespace Mono.Xml.Schema
                public XmlSchemaSet Schemas {
                        get { return schemas; }
                        set {
-                               if (validationStarted)
+                               if (ReadState != ReadState.Initial)
                                        throw new InvalidOperationException ("Schemas must be set before the first call to Read().");
                                schemas = value;
                        }
@@ -190,7 +189,7 @@ namespace Mono.Xml.Schema
                public ValidationType ValidationType {
                        get { return validationType; }
                        set {
-                               if (validationStarted)
+                               if (ReadState != ReadState.Initial)
                                        throw new InvalidOperationException ("ValidationType must be set before reading.");
                                validationType = value;
                        }
@@ -1546,7 +1545,6 @@ namespace Mono.Xml.Schema
 
                public override bool Read ()
                {
-                       validationStarted = true;
                        currentDefaultAttribute = -1;
                        defaultAttributeConsumed = false;
                        currentAttrType = null;