Exemplo n.º 1
0
        public void LoadListView(TwitterListExtended twitterListExt)
        {
            _tweetSender.txtSearchBox.Text = "";
            _userProfileView.Visibility = Visibility.Collapsed;
            _accountInfo.SelectPanel();

            SortableObservableCollection<TwitterStatus> listStatusCollections;

            TOBBaseObject Twitter = AccountManager.Instance.GetTOBObject(twitterListExt.UserAccount);
            var twitterLists = Twitter.GetStatusesFromList(twitterListExt.User.ScreenName, (long)twitterListExt.Id);
            if (twitterLists == null)
            {
                return;
            }

            string listPanelKey = "LISTPANEL" + twitterListExt.Id;
            UserAllTweets listView;

            if (_panelViewDict.ContainsKey(listPanelKey))
            {
                listView = _panelViewDict[listPanelKey];
            }
            else
            {
                listView = new UserAllTweets();
                //listView.DataTemplate = listView.FindResource("GroupsStatusesDataTemplate") as DataTemplate;

                listView.CollectionTypeFilter = TOBEntityEnum.None;

                _panelViewDict.Add(listPanelKey, listView);
            }

            listStatusCollections = new SortableObservableCollection<TwitterStatus>(twitterLists.ToList());
            listView.ListStatusCollection = listStatusCollections;
            _currentTweetsView = listView;
            _mainWindow.frmTOBMain.Content = listView;
        }
Exemplo n.º 2
0
        public override List<TwitterListExtended> GetLists()
        {
            TwitterService request = AuthenticateUser(Acc);
            List<TwitterListExtended> twitterLists = new List<TwitterListExtended>();

            var subsReq = request.ListListsFor(Acc.Username.ToLower());

            if (subsReq == null)
            {
                TOB.Logger.TOBLogger.WriteDebugInfo(request.Response.RequestUri.ToString());
            }
            else
            {
                foreach (TwitterList tl in subsReq)
                {
                    TwitterListExtended tle = new TwitterListExtended(tl);
                    tle.UserAccount = Acc;
                    twitterLists.Add(tle);
                }
            }

            //request = AuthenticateUser(Acc);

            var listsReq = request.ListListSubscriptionsFor(Acc.Username.ToLower());

            if (listsReq == null)
            {
                TOB.Logger.TOBLogger.WriteDebugInfo(request.Response.RequestUri.ToString());
            }
            else
            {
                foreach (TwitterList tl in listsReq)
                {
                    TwitterListExtended tle = new TwitterListExtended(tl);
                    tle.UserAccount = Acc;
                    twitterLists.Add(tle);
                }
            }

            return twitterLists;
        }
Exemplo n.º 3
0
 public void DeleteList(TwitterListExtended twitterListExt)
 {
     MessageBoxResult messageResult;
     messageResult = MessageBox.Show("Are you sure you want to delete this group?", "Delete Confirmation", MessageBoxButton.YesNo);
     if (messageResult == MessageBoxResult.Yes)
     {
         Account account = LocalAccountBO.Get(acc => acc.Username == twitterListExt.User.ScreenName);
         TOBBaseObject Twitter = AccountManager.Instance.GetTOBObject(account);
         Twitter.DeleteList(twitterListExt.User.ScreenName, (long)twitterListExt.Id);
         _accountInfo.DeleteLists(twitterListExt);
     }
     Panel info = null; //Need to change this
     LoadHomeView(info);
 }
Exemplo n.º 4
0
 public void DeleteLists(TwitterListExtended tListExt)
 {
     _twitterListExt.Remove(tListExt);
     listGroupsNames.ItemsSource = _twitterListExt;
 }