Esempio n. 1
0
        public void Reset()
        {
            _root = null;
            resourceTree.SelectedNode = null;
            resourceTree.Clear();

            if (Program.RootNode != null)
            {
                _root = BaseWrapper.Wrap(this, Program.RootNode);
                resourceTree.BeginUpdate();
                resourceTree.Nodes.Add(_root);
                resourceTree.SelectedNode = _root;
                _root.Expand();
                resourceTree.EndUpdate();

                closeToolStripMenuItem.Enabled  = true;
                saveAsToolStripMenuItem.Enabled = true;
                saveToolStripMenuItem.Enabled   = true;

                Program.RootNode._mainForm = this;
            }
            else
            {
                closeToolStripMenuItem.Enabled  = false;
                saveAsToolStripMenuItem.Enabled = false;
                saveToolStripMenuItem.Enabled   = false;
            }
            resourceTree_SelectionChanged(null, null);

            UpdateName();
        }
        public DialogResult ShowDialog(IWin32Window owner, RSARFolderNode parent)
        {
            _parentNode = parent;
            _newNode    = null;

            treeResource.BeginUpdate();
            foreach (ResourceNode node in parent.RSARNode.Children)
            {
                treeResource.Nodes.Add(BaseWrapper.Wrap(this, node));
            }

            BaseWrapper w = treeResource.FindResource(parent);

            treeResource.SelectedNode = w;
            w.EnsureVisible();
            w.Expand();

            treeResource.EndUpdate();

            try { return(base.ShowDialog(owner)); }
            finally { _parentNode = null; treeResource.Clear(); }
        }