Пример #1
0
 public PBBsonReaderWithBookmark Clone()
 {
     PBBsonReaderWithBookmark clone = new PBBsonReaderWithBookmark(_reader.Clone());
     clone._type = _type;
     clone._name = _name;
     clone._bsonType = _bsonType;
     clone._value = _value;
     clone._indent = _indent;
     clone._indentString = _indentString;
     return clone;
 }
Пример #2
0
        public PBBsonReaderWithBookmark Clone()
        {
            PBBsonReaderWithBookmark clone = new PBBsonReaderWithBookmark(_reader.Clone());

            clone._type         = _type;
            clone._name         = _name;
            clone._bsonType     = _bsonType;
            clone._value        = _value;
            clone._indent       = _indent;
            clone._indentString = _indentString;
            return(clone);
        }
Пример #3
0
 public PBBsonEnumerateValues(PBBsonReaderWithBookmark reader, string name = null)
 {
     _reader      = reader;
     _currentName = name;
 }
Пример #4
0
 public static void Test_BsonReader_01()
 {
     BsonPBSerializationProvider.RegisterProvider();
     try
     {
         Test_Bson_Class_01 test = Create_Test_Bson_Class_01();
         BsonDocument document = test.zToBsonDocument();
         Trace.WriteLine(document.zToJson());
         Trace.WriteLine("start reader");
         //BsonReader reader = BsonReader.Create(document);
         //BsonReader reader = BsonReader.Create(document.zToJson());
         //PBBsonReader reader = new PBBsonReader(document);
         PBBsonReaderWithBookmark reader = new PBBsonReaderWithBookmark(BsonReader.Create(document));
         while (reader.Read())
         {
             if (RunSource.CurrentRunSource.IsExecutionAborted())
                 break;
             if (reader.Type == PBBsonReaderType.Value)
             {
                 if (reader.Name != null)
                     Trace.Write("{0}: ", reader.Name);
                 Trace.WriteLine("{0} ({1})", reader.Value, reader.Value.BsonType);
             }
             else
                 Trace.WriteLine("{0}", reader.Type);
         }
     }
     finally
     {
         //UnregisterBsonPBSerializationProvider();
         BsonPBSerializationProvider.UnregisterProvider();
     }
 }