Пример #1
0
        public void AddFavourite(object sender, IMapsDirectlyToDatabaseTable o)
        {
            //it's already a favourite
            if (IsFavourite(o))
            {
                return;
            }

            var newFavourite = new Favourite(_catalogueRepository, o);

            CurrentFavourites.Add(newFavourite);
            _activator.Publish(newFavourite);
        }
Пример #2
0
        private void Publish()
        {
            var obj = GetObjectIfAnyBehind(_treeView.SelectedObject);

            if (obj != null)
            {
                _activator.Publish(obj);
            }
            else
            {
                // Selected node is not refreshable

                //refresh any object (to update core child provider)
                var anyObject = _activator.CoreChildProvider.GetAllSearchables().Keys.FirstOrDefault();

                if (anyObject != null)
                {
                    _activator.Publish(anyObject);
                }

                //and refresh the selected tree node
                _treeView.RefreshObject(_treeView.SelectedObject, true);
            }
        }