Beispiel #1
0
        public void RemoveItem(long pk)
        {
            try
            {
                var t = TopItems.ToList();
                for (int i = 0; i < t.Count; i++)
                {
                    var lst = t[i].Items.ToList();
                    for (int j = 0; j < lst.Count; j++)
                    {
                        if (lst[j].User?.Pk == pk)
                        {
                            t[i].Items.RemoveAt(j);

                            if (t[i].Items.Count == 0)
                            {
                                TopItems.Remove(t[i]);
                            }
                            break;
                        }
                    }
                }
            }
            catch { }
        }
Beispiel #2
0
        public void RemoveRoot(T1 p)
        {
            Contract.Ensures(viewer.OpenedRoot != p);

            if (roots.Remove(p))
            {
                var itemVm = FindItemVmOf(p);
                TopItems.Remove(itemVm);
            }
        }