System.Xml.Schema.XmlSchemaCollectionEnumerator Class

Assembly: System.Xml.dll
Namespace: System.Xml.Schema
Summary
Supports a simple iteration over a collection. This class cannot be inherited.
C# Syntax:
public sealed class XmlSchemaCollectionEnumerator : IEnumerator
See also:
System.Xml.Schema Namespace

System.Xml.Schema.XmlSchemaCollectionEnumerator Member List:

Public Properties
Current Read-only

Gets the current XmlSchema in the collection.
Public Methods
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
MoveNext Advances the enumerator to the next schema in the collection.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Xml.Schema.XmlSchemaCollectionEnumerator Member Details

Property: Current (read-only)
Summary
Gets the current XmlSchema in the collection.
C# Syntax:
public XmlSchema Current {get;}
Example
The following example displays each of the XML Schema definition language (XSD) schemas in the schema collection.
    public void DisplaySchemas(XmlSchemaCollection xsc)
    {
      XmlSchemaCollectionEnumerator ienum = xsc.GetEnumerator();
      while (ienum.MoveNext())
      {
        XmlSchema schema = ienum.Current;
        StringWriter sw = new StringWriter();
        XmlTextWriter writer = new XmlTextWriter(sw);
        writer.Formatting = Formatting.Indented;
        writer.Indentation = 2;
        schema.Write(writer);
        Console.WriteLine(sw.ToString());  

      }
    }

    

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~XmlSchemaCollectionEnumerator();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MoveNext()
Summary
Advances the enumerator to the next schema in the collection.
C# Syntax:
public bool MoveNext();
Return Value:
true if the move was successful; false if the enumerator has passed the end of the collection.
Example
The following example displays each of the XML Schema definition language (XSD) schemas in the schema collection.
    public void DisplaySchemas(XmlSchemaCollection xsc)
    {
      XmlSchemaCollectionEnumerator ienum = xsc.GetEnumerator();
      while (ienum.MoveNext())
      {
        XmlSchema schema = ienum.Current;
        StringWriter sw = new StringWriter();
        XmlTextWriter writer = new XmlTextWriter(sw);
        writer.Formatting = Formatting.Indented;
        writer.Indentation = 2;
        schema.Write(writer);
        Console.WriteLine(sw.ToString());  

      }
    }

    

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.