private void btnSendTweet_Click(object sender, RoutedEventArgs e) { CTConnection.getCompanyTweet().SendTweet(txtMsg.Text.ToString(), () => { this.Dispatcher.BeginInvoke(() => txtMsg.Text = ""); }, ManageExceptionCallback); }
// Code to execute when the application is deactivated (sent to background) // This code will not execute when the application is closing private void Application_Deactivated(object sender, DeactivatedEventArgs e) { try { CTConnection.getCompanyTweet().Logout(); } catch { } }
private void LoadUsersList() { CTConnection.getCompanyTweet().UsersList(users => { this.Dispatcher.BeginInvoke(() => { int i = 0; for (i = 0; i < users.size(); i++) { listBox1.Items.Add(users.getJSONObject(i).getString("username")); } }); }, ManageExceptionCallback); }
private void Follow_Users(object sender, EventArgs e) { TJSONArray users = new TJSONArray(); if (listBox1.SelectedItems.Count != 0) { for (int i = 0; i < listBox1.SelectedItems.Count; i++) { users.add(new TJSONString(listBox1.SelectedItems[i].ToString())); } CTConnection.getCompanyTweet().SetUsersToFollow(users, () => { this.Dispatcher.BeginInvoke(() => { this.NavigationService.Navigate(new Uri("/MainTweetPage.xaml", UriKind.Relative)); }); }); } else { this.Dispatcher.BeginInvoke(() => { this.NavigationService.Navigate(new Uri("/MainTweetPage.xaml", UriKind.Relative)); }); } }