/// <summary>
        /// Returns the reader to previously bookmarked position and state.
        /// </summary>
        /// <param name="bookmark">The bookmark.</param>
        public override void ReturnToBookmark(BsonReaderBookmark bookmark)
        {
            var documentReaderBookmark = (BsonDocumentReaderBookmark)bookmark;

            State           = documentReaderBookmark.State;
            CurrentBsonType = documentReaderBookmark.CurrentBsonType;
            CurrentName     = documentReaderBookmark.CurrentName;
            _context        = documentReaderBookmark.CloneContext();
            _currentValue   = documentReaderBookmark.CurrentValue;
        }
Esempio n. 2
0
        /// <summary>
        /// Returns the reader to previously bookmarked position and state.
        /// </summary>
        /// <param name="bookmark">The bookmark.</param>
        public override void ReturnToBookmark(BsonReaderBookmark bookmark)
        {
            var binaryReaderBookmark = (BsonBinaryReaderBookmark)bookmark;

            State            = binaryReaderBookmark.State;
            CurrentBsonType  = binaryReaderBookmark.CurrentBsonType;
            CurrentName      = binaryReaderBookmark.CurrentName;
            _context         = binaryReaderBookmark.CloneContext();
            _buffer.Position = binaryReaderBookmark.Position;
        }
Esempio n. 3
0
 /// <summary>
 /// Returns the reader to previously bookmarked position and state.
 /// </summary>
 /// <param name="bookmark">The bookmark.</param>
 public abstract void ReturnToBookmark(BsonReaderBookmark bookmark);