Example #1
0
        public override bool RemoveItem(AbstractDockItem item)
        {
            if (item is TimerMainDockItem)
            {
                Items = Enumerable.Empty <AbstractDockItem> ();
                foreach (AbstractDockItem adi in items)
                {
                    if (adi is TimerDockItem)
                    {
                        (adi as TimerDockItem).Finished -= HandleTimerFinished;
                    }
                    adi.Dispose();
                }
            }
            else
            {
                TimerDockItem timer = item as TimerDockItem;
                timer.Finished -= HandleTimerFinished;
                items.Remove(timer);
                Items = items;
                timer.Dispose();
            }

            return(true);
        }
Example #2
0
        void HandleTimerFinished(object o, EventArgs args)
        {
            TimerDockItem timer = o as TimerDockItem;

            timer.Finished -= HandleTimerFinished;
            items.Remove(timer);
            Items = items;
            timer.Dispose();
        }