Exemplo n.º 1
0
        private void setArchive(NefsArchive archive)
        {
            _archive = archive;
            _archivePropertyForm.SetSelectedObject(archive);
            _browseAllForm.LoadArchive(archive);
            _browseTreeForm.LoadArchive(archive);

            updateTitle();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Indicate that an item has been selected and allow appropriate parties to take action.
        /// </summary>
        /// <param name="item">List of selected items.</param>
        public void SelectNefsItem(List <NefsItem> items)
        {
            if (items == null)
            {
                throw new ArgumentNullException("Cannot provide a null list of items to select.");
            }

            _selectedItems = items;

            /* Set which item shows up in the Item's property window */
            if (_selectedItems.Count == 1)
            {
                _selectedFilePropertyForm.SetSelectedObject(_selectedItems[0]);
            }
            else
            {
                _selectedFilePropertyForm.SetSelectedObject(null);
            }

            /* Set "Item" menu visibility */
            itemToolStripMenuItem.Visible = (items.Count > 0);

            if (items.Count == 0)
            {
                return;
            }

            /* Set visibility of the Replace menu option */
            if (_selectedItems.Count > 1 ||
                _selectedItems[0].Type == NefsItem.NefsItemType.Directory)
            {
                /* Can't replace directories or multiple files right now */
                replaceContextMenuItem.Visible   = false;
                replaceToolStripMenuItem.Enabled = false;
            }
            else
            {
                /* Single file selected, can replace */
                replaceContextMenuItem.Visible   = true;
                replaceToolStripMenuItem.Enabled = true;
            }
        }