Exemplo n.º 1
0
        public void AddBroadcastHistory(BroadcastInfo info)
        {
            if (FindBroadcastHistroryItem(info) != null)
            {
                return;
            }
            var fav    = BroadcastHistory.Where(i => i.Favorite);
            var others = BroadcastHistory.Where(i => !i.Favorite);

            BroadcastHistory = fav.Concat(Enumerable.Repeat(info, 1).Concat(others.Take(19))).ToArray();
        }
Exemplo n.º 2
0
        public void AddBroadcastHistory(BroadcastInfoViewModel info)
        {
            if (BroadcastHistory.Any(i => i.Equals(info)))
            {
                return;
            }
            var fav    = BroadcastHistory.Where(i => i.Favorite);
            var others = BroadcastHistory.Where(i => !i.Favorite);

            BroadcastHistory = new ObservableCollection <BroadcastInfoViewModel>(
                fav.Concat(Enumerable.Repeat(info, 1))
                .Concat(others.Take(19))
                );
        }