private void BuildInContextMenuStrip_Opening(object sender, CancelEventArgs e) { _cutToolStripMenuItem.Enabled = _hexBox.CanCut(); _copyToolStripMenuItem.Enabled = _hexBox.CanCopy(); _pasteToolStripMenuItem.Enabled = _hexBox.CanPaste(); _selectAllToolStripMenuItem.Enabled = _hexBox.CanSelectAll(); }
/// <summary> /// Manages enabling or disabling of menustrip items and toolstrip buttons for copy and paste /// </summary> void Update_EditMenu() { HexBox hexbox = CurrentTabIsROM() ? MainHexBox : FileHexBoxes[CurrentTab]; Menu_Edit_Cut.Enabled = hexbox.CanCut(); Menu_Edit_Copy.Enabled = Menu_Edit_CopyHex.Enabled = hexbox.CanCopy(); Menu_Edit_Paste.Enabled = hexbox.CanPaste(); Menu_Edit_PasteHex.Enabled = hexbox.CanPasteHex(); }