MongoDB.Bson.RawBsonArray.GetEnumerator C# (CSharp) Method

GetEnumerator() public method

Gets an enumerator that can enumerate the elements of the array.
public GetEnumerator ( ) : IEnumerator
return IEnumerator
        public override IEnumerator<BsonValue> GetEnumerator()
        {
            ThrowIfDisposed();
            using (var bsonReader = new BsonBinaryReader(new BsonBuffer(CloneSlice(), false), true, _readerSettings))
            {
                bsonReader.ReadStartDocument();
                while (bsonReader.ReadBsonType() != BsonType.EndOfDocument)
                {
                    bsonReader.SkipName();
                    yield return DeserializeBsonValue(bsonReader);
                }
                bsonReader.ReadEndDocument();
            }
        }