Exemplo n.º 1
0
        public void RemoveFolder()
        {
            if (_tree.SelectedNode == null)
            {
                return;
            }
            var selectedNode = _tree.SelectedNode;

            if (selectedNode != _root)
            {
                var folder = selectedNode.Tag as MemoFolder;
                if (folder != null)
                {
                    if (!MessageUtil.ConfirmFolderRemoval(folder))
                    {
                        return;
                    }
                    _tree.BeginUpdate();
                    var parentNode = selectedNode.Parent;
                    selectedNode.Remove();
                    _facade.Workspace.RemoveFolder(folder);
                    _tree.SelectedNode = parentNode;
                    _tree.EndUpdate();
                }
            }
        }