Exemplo n.º 1
0
 private void btnSendTweet_Click(object sender, RoutedEventArgs e)
 {
     CTConnection.getCompanyTweet().SendTweet(txtMsg.Text.ToString(), () =>
     {
         this.Dispatcher.BeginInvoke(() => txtMsg.Text = "");
     },
                                              ManageExceptionCallback);
 }
Exemplo n.º 2
0
 // 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
     {
     }
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
        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)); });
            }
        }