//------------------------------------------------------------------------------------------- //---------------------------------각종 공용 함수------------------------------------------ //------------------------------------------------------------------------------------------- private void ShowPanel(eTweetPanel panel) { dicPanel[selectPanel].HideTreeView(); dicPanel[panel].ShowTreeView(); TweetInstence.ClearTweet(selectPanel); selectPanel = panel; if (panel == eTweetPanel.eMention) { notiMention.isOn = false; } else if (panel == eTweetPanel.eDm) { notiDm.isOn = false; } //패널 띄웠을 때 로딩된 글이 없을 경우 API콜 if (selectPanel == eTweetPanel.eDm && dicPanel[selectPanel].treeView.Items.Count < 2) { DalsaeInstence.LoadTweet(eTweetPanel.eDm); } else if (selectPanel == eTweetPanel.eFavorite && dicPanel[selectPanel].treeView.Items.Count < 2) { DalsaeInstence.LoadTweet(eTweetPanel.eFavorite); } else if (selectPanel == eTweetPanel.eMention && dicPanel[selectPanel].treeView.Items.Count < 2) { DalsaeInstence.LoadTweet(eTweetPanel.eMention); } dicPanel[selectPanel].Focus(); }
private void contextClick_Url(object sender, RoutedEventArgs e) { MenuItem item = sender as MenuItem; if (item == null) { return; } ClientTweet tweet = selectTweet; if (tweet == null) { return; } for (int i = 0; i < tweet.listUrl.Count; i++) { ClientURL url = item.Tag as ClientURL; if (url == null) { continue; } if (tweet.listUrl[i].expanded_url == url.expanded_url) { System.Diagnostics.Process.Start(tweet.listUrl[i].expanded_url); TweetInstence.AddTweet(eTweetPanel.eOpen, tweet); break; } } }
private void viewWeb_Click(object sender, RoutedEventArgs e) { if (tweet == null) { return; } string url = $"https://twitter.com/{tweet.user.screen_name}/status/{tweet.id}"; System.Diagnostics.Process.Start(url); TweetInstence.AddTweet(eTweetPanel.eOpen, tweet); }
private void ResponseUSTweet(ClientTweet tweet) { tweet.Init(); if (tweet.isRetweet && DataInstence.CheckIsMe(tweet.user.id)) { tweet.originalTweet.retweeted = true; } TweetInstence.AddTweet(eTweetPanel.eHome, tweet); //DeleAddTweet dele = new DeleAddTweet(TweetInstence.AddTweet); //Application.Current.Dispatcher.BeginInvoke(dele, new object[] { eTweetPanel.eHome, tweet }); }
private void ResponseUserMediaMore(List <ClientTweet> listTweet) { List <ClientTweet> listMedia = new List <ClientTweet>(); for (int i = 0; i < listTweet.Count; i++) { if (listTweet[i].isMedia) { listMedia.Add(listTweet[i]); } } TweetInstence.AddTweet(eTweetPanel.eUserMedia, listMedia, true); }
public void FindNextUserTweet(long id) { if (listTweet == null) { return; } int startIndex = FindParentIndex(treeView.SelectedItem as ClientTweet, listTweet); int index = TweetInstence.FindNextUserTweet(listTweet, startIndex, id); if (index == -1) { return; } FocusTreeViewItem(listTweet[index], index); }
private void ShowWeb() { ClientTweet tweet = selectTweet; if (tweet == null) { return; } if (tweet.originalTweet == null) { return; } string url = $"https://twitter.com/{tweet.originalTweet.user.screen_name}/status/{tweet.originalTweet.id}"; System.Diagnostics.Process.Start(url); TweetInstence.AddTweet(eTweetPanel.eOpen, tweet); }
private void FindTweet(string text) { TreeViewManager panel = dicPanel[selectPanel]; int index = TweetInstence.FindTweet(selectPanel, panel.treeView.SelectedItem as ClientTweet, text); if (index == -1) { return; } TreeViewItem selTweet = panel.treeView.ItemContainerGenerator.ContainerFromIndex(index) as TreeViewItem; //panel.listBox.Items.MoveCurrentTo(selTweet); selTweet.IsSelected = true; selTweet.Focus(); textBoxFind.Focus(); }
private void contextClick_Url(object sender, RoutedEventArgs e) { MenuItem item = sender as MenuItem; if (item == null) { return; } if (tweet == null) { return; } for (int i = 0; i < tweet.listUrl.Count; i++) { if (tweet.listUrl[i].display_url == item.Header.ToString()) { System.Diagnostics.Process.Start(tweet.listUrl[i].expanded_url); TweetInstence.AddTweet(eTweetPanel.eOpen, tweet); break; } } }
private void ResponseUserTweet(List <ClientTweet> listTweet) { TweetInstence.AddTweet(eTweetPanel.eUser, listTweet, false); }
private void ResponseUnFavorite(ClientTweet tweet) { tweet.Init(); TweetInstence.FavoriteTweet(tweet, tweet.favorited); }
private void ResponseFavoriteMore(List <ClientTweet> listTweet) { TweetInstence.AddTweet(eTweetPanel.eFavorite, listTweet, true); }
private void ResponseMentionMore(List <ClientTweet> listTweet) { TweetInstence.AddTweet(eTweetPanel.eMention, listTweet, true); }
private void ResponseUserMore(List <ClientTweet> listTweet) { TweetInstence.AddTweet(eTweetPanel.eUser, listTweet, true); }
private void ResponseRetweet(ClientTweet tweet) { tweet.Init(); TweetInstence.Retweet(tweet, true); }
private void ResponseUSDelete(ClientStreamDelete delete) { TweetInstence.DeleteTweet(delete); //DDeleteTweet dele = new DDeleteTweet(TweetInstence.DeleteTweet); //Application.Current.Dispatcher.BeginInvoke(dele, new object[] { delete }); }
private void ResponseUnRetweet(ClientTweet tweet) { tweet.Init(); TweetInstence.Retweet(tweet, false); }
private void Refresh() { TweetInstence.ClearTweet(selectPanel); }