Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. public static void getHistoryBuyOrders(ListingsView view)
  2.         {
  3.             var request = new RestRequest("commerce/transactions/current/buys");
  4.             Action<List<RestListing>> arp = view.processHistoryBuyOrders;
  5.             executeAsyncWithKey(request, arp);
  6.         }
  7.  
  8. public static void executeAsyncWithKey<T>(RestRequest request, Action<T> callback) where T : new()
  9.         {
  10.             var client = new RestClient();
  11.             client.BaseUrl = BaseUrl;
  12.             request.AddParameter("access_token", APIKEY);
  13.  
  14.             var asyncHandle = client.ExecuteAsync<T>(request, aresp =>
  15.             {
  16.                 callback(aresp.Data);
  17.             });
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement