public void SetCategoryChangeDelegate(TaskCategoryChangeDelegate changeDelegate)
        {
            if (changeDelegate == null)
            {
                return;
            }

            categoryChangeDelegate = changeDelegate;

            // request new categories in case of preference change
            categoryChangeDelegate?.Invoke();
        }
Esempio n. 2
0
        public void SetCategoryChangeDelegate(TaskCategoryChangeDelegate changeDelegate)
        {
            if (changeDelegate == null)
            {
                return;
            }

            categoryChangeDelegate = changeDelegate;
            _appGrabber.CategoryList.CategoryChanged   += (sender, args) => categoryChangeDelegate();
            _appGrabber.CategoryList.CollectionChanged += CategoryList_CollectionChanged;

            // request new categories in case of preference change
            // nullify all existing categories so we don't attempt reuse
            foreach (ApplicationWindow window in _shellManager.Tasks.GroupedWindows)
            {
                window.Category = null;
            }
            categoryChangeDelegate?.Invoke();
        }