Пример #1
0
        public void RemoveTag()
        {
            var node = SelectedNode;

            if (node == null || node == _tagRootNode)
            {
                return;
            }
            var parentTag = node.Parent.Tag as MemoTag;

            var tag = node.Tag as MemoTag;

            if (tag == null)
            {
                return;
            }

            if (!MessageUtil.ConfirmTagRemoval(tag))
            {
                return;
            }

            _facade.Workspace.RemoveTag(tag);

            UpdateTags();
            if (parentTag == null)
            {
                SelectedNode = _tagRootNode;
            }
            else
            {
                SelectMemoTag(parentTag);
            }
        }
Пример #2
0
        public void RemoveTag()
        {
            if (!IsTagSelected)
            {
                return;
            }
            var node      = _tree.SelectedNode;
            var parentTag = node.Parent.Tag as MemoTag;

            var tag = node.Tag as MemoTag;

            if (tag == null)
            {
                return;
            }

            if (!MessageUtil.ConfirmTagRemoval(tag))
            {
                return;
            }

            _facade.Workspace.RemoveTag(tag);
            node.Remove();
            //RebuildTree();

            if (parentTag == null)
            {
                _tree.SelectedNode = _root;
            }
            else
            {
                SelectNode(parentTag);
            }
        }