// protected methods /// <summary> /// Deserializes a value. /// </summary> /// <param name="context">The deserialization context.</param> /// <param name="args">The deserialization args.</param> /// <returns>The value.</returns> protected override GeoJsonGeometryCollection <TCoordinates> DeserializeValue(BsonDeserializationContext context, BsonDeserializationArgs args) { var geoJsonObjectArgs = new GeoJsonObjectArgs <TCoordinates>(); List <GeoJsonGeometry <TCoordinates> > geometries = null; _helper.DeserializeMembers(context, (elementName, flag) => { switch (flag) { case Flags.Geometries: geometries = DeserializeGeometries(context); break; default: _helper.DeserializeBaseMember(context, elementName, flag, geoJsonObjectArgs); break; } }); return(new GeoJsonGeometryCollection <TCoordinates>(geoJsonObjectArgs, geometries)); }
// protected methods /// <summary> /// Deserializes a value. /// </summary> /// <param name="context">The deserialization context.</param> /// <param name="args">The deserialization args.</param> /// <returns>The value.</returns> protected override GeoJsonMultiPoint <TCoordinates> DeserializeValue(BsonDeserializationContext context, BsonDeserializationArgs args) { var geoJsonObjectArgs = new GeoJsonObjectArgs <TCoordinates>(); GeoJsonMultiPointCoordinates <TCoordinates> coordinates = null; _helper.DeserializeMembers(context, (elementName, flag) => { switch (flag) { case Flags.Coordinates: coordinates = DeserializeCoordinates(context); break; default: _helper.DeserializeBaseMember(context, elementName, flag, geoJsonObjectArgs); break; } }); return(new GeoJsonMultiPoint <TCoordinates>(geoJsonObjectArgs, coordinates)); }
// protected methods /// <summary> /// Deserializes a value. /// </summary> /// <param name="context">The deserialization context.</param> /// <returns>The value.</returns> protected override GeoJsonFeatureCollection <TCoordinates> DeserializeValue(BsonDeserializationContext context) { var args = new GeoJsonObjectArgs <TCoordinates>(); List <GeoJsonFeature <TCoordinates> > features = null; _helper.DeserializeMembers(context, (elementName, flag) => { switch (flag) { case Flags.Features: features = DeserializeFeatures(context); break; default: _helper.DeserializeBaseMember(context, elementName, flag, args); break; } }); return(new GeoJsonFeatureCollection <TCoordinates>(args, features)); }
// protected methods /// <summary> /// Deserializes a value. /// </summary> /// <param name="context">The deserialization context.</param> /// <param name="args">The deserialization args.</param> /// <returns>The value.</returns> protected override GeoJsonFeature <TCoordinates> DeserializeValue(BsonDeserializationContext context, BsonDeserializationArgs args) { var geoJsonFeatureArgs = new GeoJsonFeatureArgs <TCoordinates>(); GeoJsonGeometry <TCoordinates> geometry = null; _helper.DeserializeMembers(context, (elementName, flag) => { switch (flag) { case Flags.Geometry: geometry = DeserializeGeometry(context); break; case Flags.Id: geoJsonFeatureArgs.Id = DeserializeId(context); break; case Flags.Properties: geoJsonFeatureArgs.Properties = DeserializeProperties(context); break; default: _helper.DeserializeBaseMember(context, elementName, flag, geoJsonFeatureArgs); break; } }); return(new GeoJsonFeature <TCoordinates>(geoJsonFeatureArgs, geometry)); }