Наследование: BuilderBase, IMongoGeoNearOptions
Пример #1
0
 private void cmdGeoNear_Click(object sender, EventArgs e)
 {
     GeoNearOptionsBuilder GeoOption = new GeoNearOptionsBuilder();
     GeoOption.SetDistanceMultiplier(double.Parse(NumDistanceMultiplier.Text));
     GeoOption.SetMaxDistance(double.Parse(NumMaxDistance.Text));
     GeoOption.SetSpherical(chkSpherical.Checked);
     try
     {
         BsonDocument mGeoNearAs = SystemManager.GetCurrentCollection().GeoNearAs<BsonDocument>
             (null, double.Parse(NumGeoX.Text), double.Parse(NumGeoY.Text), (int)NumResultCount.Value, GeoOption).Response;
         MongoDBHelper.FillDataToTreeView("Result", this.trvGeoResult, mGeoNearAs);
         this.trvGeoResult.DatatreeView.Nodes[0].Expand();
     }
     catch (Exception ex)
     {
         SystemManager.ExceptionDeal(ex);
     }
 }
Пример #2
0
 private void cmdGeoNear_Click(object sender, EventArgs e)
 {
     List<BsonDocument> SrvDocList = new List<BsonDocument>();
     GeoNearOptionsBuilder opt = new GeoNearOptionsBuilder();
     opt.SetDistanceMultiplier((double)NumDistanceMultiplier.Value);
     opt.SetMaxDistance((double)NumMaxDistance.Value);
     opt.SetSpherical(chkSpherical.Checked);
     BsonDocument T = SystemManager.GetCurrentCollection().GeoNearAs<BsonDocument>
         (null, (int)NumGeoX.Value, (int)NumGeoY.Value, (int)NumResultCount.Value,opt).Response;
     SrvDocList.Add(T);
     MongoDBHelper.FillDataToTreeView("Result", this.trvGeoResult, SrvDocList, 0);
     this.trvGeoResult.DatatreeView.Nodes[0].Expand();
 }