Esempio n. 1
0
        //-------------------------------------------------------------------------------------------
        //---------------------------------각종 공용 함수------------------------------------------
        //-------------------------------------------------------------------------------------------

        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();
        }
Esempio n. 2
0
        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;
                }
            }
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 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 });
 }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
        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);
        }
Esempio n. 8
0
        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();
        }
Esempio n. 9
0
        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;
                }
            }
        }
Esempio n. 10
0
 private void ResponseUserTweet(List <ClientTweet> listTweet)
 {
     TweetInstence.AddTweet(eTweetPanel.eUser, listTweet, false);
 }
Esempio n. 11
0
 private void ResponseUnFavorite(ClientTweet tweet)
 {
     tweet.Init();
     TweetInstence.FavoriteTweet(tweet, tweet.favorited);
 }
Esempio n. 12
0
 private void ResponseFavoriteMore(List <ClientTweet> listTweet)
 {
     TweetInstence.AddTweet(eTweetPanel.eFavorite, listTweet, true);
 }
Esempio n. 13
0
 private void ResponseMentionMore(List <ClientTweet> listTweet)
 {
     TweetInstence.AddTweet(eTweetPanel.eMention, listTweet, true);
 }
Esempio n. 14
0
 private void ResponseUserMore(List <ClientTweet> listTweet)
 {
     TweetInstence.AddTweet(eTweetPanel.eUser, listTweet, true);
 }
Esempio n. 15
0
 private void ResponseRetweet(ClientTweet tweet)
 {
     tweet.Init();
     TweetInstence.Retweet(tweet, true);
 }
Esempio n. 16
0
 private void ResponseUSDelete(ClientStreamDelete delete)
 {
     TweetInstence.DeleteTweet(delete);
     //DDeleteTweet dele = new DDeleteTweet(TweetInstence.DeleteTweet);
     //Application.Current.Dispatcher.BeginInvoke(dele, new object[] { delete });
 }
Esempio n. 17
0
 private void ResponseUnRetweet(ClientTweet tweet)
 {
     tweet.Init();
     TweetInstence.Retweet(tweet, false);
 }
Esempio n. 18
0
 private void Refresh()
 {
     TweetInstence.ClearTweet(selectPanel);
 }