void tobbaseobject_NewStatus(TOBBaseObject from, TOBEventArgs args)
        {
            //TOB.Logger.TOBLogger.WriteInfo("NewStatus - " + args.EntityList.Count);

            //Update internal Collection (Might not be needed at all)
            foreach (TOBEntityBase item in args.EntityList)
            {
                if (args.TweetEnum == TOBEntityEnum.Status)
                {
                    _statusCollection.Insert(0, item);
                }
                else if (args.TweetEnum == TOBEntityEnum.DirectMessages)
                {
                    _directMessagesCollection.Insert(0, item);
                }
            }

            //Flush out old objects in _statusCollection
            if (_statusCollection.Count > (int)(MAX_COLLECTION_OBJECTS * 1.1))
            {
                while (_statusCollection.Count > MAX_COLLECTION_OBJECTS)
                {
                    _statusCollection.RemoveAt(_statusCollection.Count - 1);
                }
            }
            //Flush out old objects in _directMessageCollection
            if (_directMessagesCollection.Count > (int)(MAX_COLLECTION_OBJECTS * 1.1))
            {
                while (_directMessagesCollection.Count > MAX_COLLECTION_OBJECTS)
                {
                    _directMessagesCollection.RemoveAt(_directMessagesCollection.Count - 1);
                }
            }

            if (_panelViewDict.Values.Count == 0)
            {
                TOB.Logger.TOBLogger.WriteDebugInfo("ERROR - PanelViewDict Values are 0 ... Potential dataloss can occur");
            }

            foreach (KeyValuePair<string,UserAllTweets> catchedPanelPair in _panelViewDict)
            {
              //  cachedPanel.AddList(args.EntityList,_currentPanel.AccountList);
                UserAllTweets cachedPanel = catchedPanelPair.Value;
                if (catchedPanelPair.Key == _currentPanel.PanelName.ToString())
                {
                    cachedPanel.AddList(args.EntityList, _currentPanel.AccountList);
                }
                else
                {
                    cachedPanel.AddList(args.EntityList, null);
                }

            }
        }
Exemple #2
0
 protected void OnNewStatus(TOBBaseObject current,TOBEventArgs e)
 {
     if (NewStatus != null)
     {
         NewStatus(current,e);
     }
 }
Exemple #3
0
 public void tob_NewStatus(TOBBaseObject from, TOBEventArgs args)
 {
     Action action = delegate()
     {
     var balloon = new NotifyBaloon();
     balloon.GetNotifications(args.EntityList);
     ShowCustomBalloon(balloon, PopupAnimation.Scroll, 40000);
     };
     Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, action);
 }
Exemple #4
0
 protected void OnNewList(TOBBaseObject current, List<TwitterListExtended> twitterList)
 {
     if (NewList != null)
     {
         NewList(current, twitterList);
     }
 }
Exemple #5
0
        public void tobbase_NewList(TOBBaseObject from, List<TwitterListExtended> twitterLists)
        {
            Action action = delegate()
            {
                foreach (TwitterListExtended tle in twitterLists)
                {
                    tle.CommandDeleteGroups = TOBCommands.DeleteGroupCommand;
                    tle.CommandGroups = TOBCommands.GroupsCommand;

                    TwitterListExtended existingTLE = _twitterListExt.Where(t => t.Id == tle.Id).FirstOrDefault();

                    if (existingTLE != null)
                    {
                        _twitterListExt[_twitterListExt.IndexOf(existingTLE)] = tle;
                    }
                    else
                    {
                        _twitterListExt.Add(tle);
                    }
                }
            };
            Dispatcher.BeginInvoke(DispatcherPriority.Normal, action);
        }