public HomeViewController() : base("HomeViewController", null) { Title = NSBundle.MainBundle.LocalizedString ("Games", "Games"); restFacilitator = new RestFacilitator(); restService = new RestService(restFacilitator, baseUri); }
private void Button_Click_1(object sender, RoutedEventArgs e) { var baseUri = "http://search.twitter.com/"; var restFacilitator = new RestFacilitator(); var restService = new RestService(restFacilitator, baseUri); var asyncDelegation = new AsyncDelegation(restService); //call http://search.twitter.com/search.json?q=#haiku asyncDelegation.Get<Hash>("search.json", new { q = "#haiku" }) .WhenFinished( result => { List<string> tweets = new List<string>(); textBlockTweets.Text = ""; foreach (var tweetObject in result["results"].ToHashes()) { textBlockTweets.Text += HttpUtility.HtmlDecode(tweetObject["text"].ToString()) + Environment.NewLine + Environment.NewLine; } }); asyncDelegation.Go(); }
private void Button_Click(object sender, RoutedEventArgs e) { var baseUri = "http://search.twitter.com/"; var restFacilitator = new RestFacilitator(); var restService = new RestService(restFacilitator, baseUri); var asyncDelegation = new AsyncDelegation(restService); asyncDelegation.Get<TwitterProxy.twitterresults>("search.json", new { q = "#haiku" }) .WhenFinished( result => { List<string> tweets = new List<string>(); textBlockTweets.Text = ""; tweets = result.results.Select(s => s.text).ToList(); foreach (string tweet in tweets) { textBlockTweets.Text += HttpUtility.HtmlDecode(tweet) + Environment.NewLine + Environment.NewLine; } }); asyncDelegation.Go(); }
public HelloRestViewController() : base("HelloRestViewController", null) { restFacilitator = new RestFacilitator(); restService = new RestService(restFacilitator, baseUri); peeps = new List<string>(); }
public GameViewController(Guid gameId) : base("GameViewController", null) { Title = NSBundle.MainBundle.LocalizedString ("Name", "Name"); restFacilitator = new RestFacilitator(); restService = new RestService(restFacilitator, baseUri); _gameId = gameId; }
private void Button_Click_2(object sender, RoutedEventArgs e) { var baseUri = "http://search.twitter.com/"; var restFacilitator = new RestFacilitator(); var restService = new RestService(restFacilitator, baseUri); var asyncDelegation = new AsyncDelegation(restService); asyncDelegation.Get<Hash>("search.json", new { q = "#haiku" }) .WhenFinished( result => { JsonVisualization jsonVisualization = new JsonVisualization(); jsonVisualization.Parse("root", result, 0); textBlockTweets.Text = jsonVisualization.JsonResult; }); asyncDelegation.Go(); }
void before_each() { ResetDbs(); Rest = new RestFacilitator("http://localhost:3000"); }
public void Calculate() { RestFacilitator rf; rf = new RestFacilitator(); RestService rs = new RestService(rf, _baseUri); AsyncDelegation ad = new AsyncDelegation(rs); int temp = 0; ad.Get<dynamic>( "Calculator/Add", new { x = X, y = Y }) .WhenFinished(r => temp = (int)r.Value) .ThenGet<dynamic>("Calculator/Subtract").ForRoute( () => new { x = temp, y = Subtract }) .WhenFinished(r => temp = (int)r.Value) .ThenGet<dynamic>("Calculator/Multiply").ForRoute( () => new { x = temp, y = Multiply }) .WhenFinished(r => Answer = (int)r.Value); ad.Go(); }