public SpotNearbyResponse lookupNearby(Location location, SpotCategory category, string query, string countryAreaCode) { #if !SILVERLIGHT send_lookupNearby(location, category, query, countryAreaCode); return(recv_lookupNearby()); #else var asyncResult = Begin_lookupNearby(null, null, location, category, query, countryAreaCode); return(End_lookupNearby(asyncResult)); #endif }
public void send_lookupNearby(Location location, SpotCategory category, string query, string countryAreaCode) { oprot_.WriteMessageBegin(new TMessage("lookupNearby", TMessageType.Call, seqid_)); lookupNearby_args args = new lookupNearby_args(); args.Location = location; args.Category = category; args.Query = query; args.CountryAreaCode = countryAreaCode; args.Write(oprot_); oprot_.WriteMessageEnd(); oprot_.Transport.Flush(); }
public void send_lookupNearby(Location location, SpotCategory category, string query, string countryAreaCode) #endif { oprot_.WriteMessageBegin(new TMessage("lookupNearby", TMessageType.Call, seqid_)); lookupNearby_args args = new lookupNearby_args(); args.Location = location; args.Category = category; args.Query = query; args.CountryAreaCode = countryAreaCode; args.Write(oprot_); oprot_.WriteMessageEnd(); #if SILVERLIGHT return(oprot_.Transport.BeginFlush(callback, state)); #else oprot_.Transport.Flush(); #endif }
public static List <Spot> Read(SpotCategory category) { List <Spot> categorySpots = new List <Spot>(); using (SQLiteConnection conn = new SQLiteConnection(App.DatabasaLocation)) { conn.CreateTable <Spot>(); var spots = conn.Table <Spot>().ToList(); foreach (Spot spot in spots) { if (spot.Categories == category) { categorySpots.Add(spot); } } } return(categorySpots); }
public async Task <SpotNearbyResponse> lookupNearbyAsync(Location location, SpotCategory category, string query, string countryAreaCode, CancellationToken cancellationToken) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("lookupNearby", TMessageType.Call, SeqId), cancellationToken); var args = new lookupNearbyArgs(); args.Location = location; args.Category = category; args.Query = query; args.CountryAreaCode = countryAreaCode; await args.WriteAsync(OutputProtocol, cancellationToken); await OutputProtocol.WriteMessageEndAsync(cancellationToken); await OutputProtocol.Transport.FlushAsync(cancellationToken); var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken); if (msg.Type == TMessageType.Exception) { var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); throw x; } var result = new lookupNearbyResult(); await result.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); if (result.__isset.success) { return(result.Success); } if (result.__isset.e) { throw result.E; } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "lookupNearby failed: unknown result"); }
public List <Spot> GetSpots(SpotCategory category) { return(DummySpotsData.Read(category)); }
public IAsyncResult send_lookupNearby(AsyncCallback callback, object state, Location location, SpotCategory category, string query, string countryAreaCode)
public IAsyncResult Begin_lookupNearby(AsyncCallback callback, object state, Location location, SpotCategory category, string query, string countryAreaCode) { return(send_lookupNearby(callback, state, location, category, query, countryAreaCode)); }
public IAsyncResult send_lookupNearby(AsyncCallback callback, object state, Location location, SpotCategory category, string query, string countryAreaCode) { oprot_.WriteMessageBegin(new TMessage("lookupNearby", TMessageType.Call, seqid_)); lookupNearby_args args = new lookupNearby_args(); args.Location = location; args.Category = category; args.Query = query; args.CountryAreaCode = countryAreaCode; args.Write(oprot_); oprot_.WriteMessageEnd(); return(oprot_.Transport.BeginFlush(callback, state)); }