public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var bsonType = bsonReader.PeekBsonType();
     BsonArray value;
     if (bsonType == BsonType.Null) {
         bsonReader.ReadNull(propertyMap.ElementName);
         value = null;
     } else {
         bsonReader.ReadArrayName(propertyMap.ElementName);
         value = BsonArray.ReadFrom(bsonReader);
     }
     propertyMap.Setter(obj, value);
 }
 public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     BsonType bsonType = bsonReader.PeekBsonType();
     object value;
     if (bsonType == BsonType.Null) {
         bsonReader.ReadNull(propertyMap.ElementName);
         value = null;
     } else {
         bsonReader.ReadDocumentName(propertyMap.ElementName);
         value = BsonSerializer.Deserialize(bsonReader, propertyMap.PropertyInfo.PropertyType);
     }
     propertyMap.Setter(obj, value);
 }
 public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var bsonType = bsonReader.PeekBsonType();
     BsonObjectId value;
     if (bsonType == BsonType.Null) {
         bsonReader.ReadNull(propertyMap.ElementName);
         value = null;
     } else {
         int timestamp;
         long machinePidIncrement;
         bsonReader.ReadObjectId(propertyMap.ElementName, out timestamp, out machinePidIncrement);
         value = new BsonObjectId(timestamp, machinePidIncrement);
     }
     propertyMap.Setter(obj, value);
 }
 public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var bsonType = bsonReader.PeekBsonType();
     BsonNull value;
     if (bsonType == BsonType.Document) {
         bsonReader.ReadDocumentName(propertyMap.ElementName);
         bsonReader.ReadStartDocument();
         bsonReader.VerifyString("$null", "c#null");
         bsonReader.ReadEndDocument();
         value = null;
     } else {
         bsonReader.ReadNull(propertyMap.ElementName);
         value = Bson.Null;
     }
     propertyMap.Setter(obj, value);
 }
 public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var bsonType = bsonReader.PeekBsonType();
     BsonJavaScriptWithScope value;
     if (bsonType == BsonType.Null) {
         bsonReader.ReadNull(propertyMap.ElementName);
         value = null;
     } else {
         var code = bsonReader.ReadJavaScriptWithScope(propertyMap.ElementName);
         var scope = BsonDocument.ReadFrom(bsonReader);
         value = new BsonJavaScriptWithScope(code, scope);
     }
     propertyMap.Setter(obj, value);
 }
 public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var bsonType = bsonReader.PeekBsonType();
     BsonJavaScript value;
     if (bsonType == BsonType.Null) {
         bsonReader.ReadNull(propertyMap.ElementName);
         value = null;
     } else {
         value = new BsonJavaScript(bsonReader.ReadJavaScript(propertyMap.ElementName));
     }
     propertyMap.Setter(obj, value);
 }
 public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var bsonType = bsonReader.PeekBsonType();
     BsonInt64 value;
     if (bsonType == BsonType.Null) {
         bsonReader.ReadNull(propertyMap.ElementName);
         value = null;
     } else {
         value = BsonInt64.Create(bsonReader.ReadInt64(propertyMap.ElementName));
     }
     propertyMap.Setter(obj, value);
 }
 public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var bsonType = bsonReader.PeekBsonType();
     BsonValue value;
     if (bsonType == BsonType.Null) {
         bsonReader.ReadNull(propertyMap.ElementName);
         value = null;
     } else {
         BsonElement element = BsonElement.ReadFrom(bsonReader, propertyMap.ElementName);
         value = element.Value;
     }
     propertyMap.Setter(obj, value);
 }
 public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var bsonType = bsonReader.PeekBsonType();
     BsonBinaryData value;
     if (bsonType == BsonType.Null) {
         bsonReader.ReadNull(propertyMap.ElementName);
         value = null;
     } else {
         byte[] bytes;
         BsonBinarySubType subType;
         bsonReader.ReadBinaryData(propertyMap.ElementName, out bytes, out subType);
         value = new BsonBinaryData(bytes, subType);
     }
     propertyMap.Setter(obj, value);
 }
 public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var bsonType = bsonReader.PeekBsonType();
     BsonRegularExpression value;
     if (bsonType == BsonType.Null) {
         bsonReader.ReadNull(propertyMap.ElementName);
         value = null;
     } else {
         string pattern, options;
         bsonReader.ReadRegularExpression(propertyMap.ElementName, out pattern, out options);
         value = new BsonRegularExpression(pattern, options);
     }
     propertyMap.Setter(obj, value);
 }