private async void checkNewMentions(StoredStatus firstMention) { //Set the database path and initilize the database connection var path = Windows.Storage.ApplicationData.Current.LocalFolder.Path + @"\" + Constants.getDbName(); SQLiteAsyncConnection db = new SQLiteAsyncConnection(path); //We obtain the status List <StoredStatus> storedMentions = await db.QueryAsync <StoredStatus>("SELECT * FROM StoredStatuses where isMention = ?", true); //We obtain the first status ID Debug.WriteLine("First new mention: " + firstMention.StatusID.ToString()); Debug.WriteLine("First stored mention: " + storedMentions.First().StatusID.ToString()); if (firstMention.StatusID != storedMentions.First().StatusID) { Debug.WriteLine("Nueva mención!"); } else { Debug.WriteLine("No hay nuevas menciones =("); } }
/** * This method is launched when "new Tweet" button is pressed. * Write tweet window become visible. * In the textbox is automatically written the user it is wanted reply. */ private void openWindowNewTweet(object sender, PointerRoutedEventArgs e) { StoredStatus selectedStatus = (StoredStatus)timelinegridview.SelectedItem; //Get replied user screenname if (selectedStatus != null) { replyid = selectedStatus.StatusID; replynamesize = selectedStatus.ScreenName.Length + 1; tweetbox.Text = "@" + selectedStatus.ScreenName + " "; replyicon.Visibility = Windows.UI.Xaml.Visibility.Visible; replyscreenname.Text = selectedStatus.ScreenName; } else { replyid = ""; replynamesize = 0; tweetbox.Text = ""; replyicon.Visibility = Windows.UI.Xaml.Visibility.Collapsed; } newtweetgrid.Visibility = Windows.UI.Xaml.Visibility.Visible; graygridoverlay.Visibility = Windows.UI.Xaml.Visibility.Visible; }