Beispiel #1
0
        public static DGUser GetUser(User user)
        {
            DGUser dg = m_users.FirstOrDefault(u => u.Identifier.ScreenName.Equals(user.Identifier.ScreenName, StringComparison.OrdinalIgnoreCase));

            if (dg == null)
            {
                dg = new DGUser(user);
                m_users.Add(dg);
            }

            return(dg);
        }
Beispiel #2
0
        public static DGUser GetUser(User user)
        {
            DGUser dg = m_users.FirstOrDefault(u => u.Identifier.ScreenName.Equals(user.Identifier.ScreenName, StringComparison.OrdinalIgnoreCase));

            if (dg == null)
            {
                dg = new DGUser(user);
                m_users.Add(dg);
            }

            return dg;
        }
Beispiel #3
0
        public DGStatus(Status source, DGAccount account)
        {
            m_visbile = true;
            Source    = source;
            Account   = account;
            User      = DGUser.GetUser(source.User);

            var mediaEntities = source.Entities.MediaEntities.Where(m => m.Type.Equals("photo", StringComparison.OrdinalIgnoreCase));

            if (mediaEntities.Any())
            {
                MainImageUrl = mediaEntities.First().MediaUrl;
                HasImages    = true;
            }
        }
        public void AddUser(DGUser user)
        {
            if (Users.Count(u => u.Identifier.ScreenName.Equals(user.Identifier.ScreenName, StringComparison.OrdinalIgnoreCase)) > 0)
            {                
                Users.Remove(user);
            }
            
            if (Users.Count == MaxUsers)
            {
                var oldestUser = Users[MaxUsers - 1];
                oldestUser.Visible = false;
                Users.Remove(oldestUser);
            }

            Users.Insert(0, user);

            Dispatcher.Invoke(DispatcherPriority.Normal, (Action)(() =>
            {
                ListViewUsers.DataContext = null;
                ListViewUsers.DataContext = Users;  
            }));                        
        }
Beispiel #5
0
 public DGAccount(Account source)
 {
     Source    = source;
     User      = DGUser.GetUser(source.User);
     m_visible = true;
 }