System.Xml.XmlValidatingReader.Close C# (CSharp) Méthode

Close() public méthode

public Close ( ) : void
Résultat void
        public override void Close() {
            impl.Close();
        }

Usage Example

        public BaseCodeGenerator(Stream sourceXML) 
        {
            XmlDocument doc = new XmlDocument();
            using (sourceXML)
            {
                doc.Load(sourceXML);
            }

            MemoryStream ms = new MemoryStream();
            doc.Save(ms);

            ms.Position = 0;

            using (XmlTextReader r = new XmlTextReader(ms))
            {
                XmlValidatingReader v = new XmlValidatingReader(r);
                v.ValidationType = ValidationType.Schema;
                v.ValidationEventHandler += new ValidationEventHandler(v_ValidationEventHandler);
                while (v.Read())
                {
                }
                v.Close();
            }

            if (m_errors)
                throw new InvalidDataException("The Xml input did not match the schema");

            Parse(doc);
        }
All Usage Examples Of System.Xml.XmlValidatingReader::Close