private void AddContextMenuStripItems() { _itemHighlight = new ToolStripMenuItem("Highlight"); _itemHighlight.Click += (sender, e) => ToggleHighlighted(); _itemHighlight.Checked = _watchVarControl.ShowBorder; _itemLock = new ToolStripMenuItem("Lock"); _itemLock.Click += (sender, e) => ToggleLocked(_watchVarControl.FixedAddressList); _itemRemoveAllLocks = new ToolStripMenuItem("Remove All Locks"); _itemRemoveAllLocks.Click += (sender, e) => { WatchVariableLockManager.RemoveAllLocks(); }; ToolStripMenuItem itemCopyUnrounded = new ToolStripMenuItem("Copy"); itemCopyUnrounded.Click += (sender, e) => { Clipboard.SetText(GetStringValue(false)); }; ToolStripMenuItem itemPaste = new ToolStripMenuItem("Paste"); itemPaste.Click += (sender, e) => { bool success = SetStringValue(Clipboard.GetText()); if (!success) { _watchVarControl.FlashColor(WatchVariableControl.FAILURE_COLOR); } }; _contextMenuStrip.AddToBeginningList(_itemHighlight); _contextMenuStrip.AddToBeginningList(_itemLock); _contextMenuStrip.AddToBeginningList(_itemRemoveAllLocks); _contextMenuStrip.AddToBeginningList(itemCopyUnrounded); _contextMenuStrip.AddToBeginningList(itemPaste); }
private void AddContextMenuStripItems() { _itemHighlight = new ToolStripMenuItem("Highlight"); _itemHighlight.Click += (sender, e) => _watchVarControl.ToggleHighlighted(); _itemHighlight.Checked = _watchVarControl.Highlighted; _itemLock = new ToolStripMenuItem("Lock"); _itemLock.Click += (sender, e) => ToggleLocked(null, _watchVarControl.FixedAddressList); _itemRemoveAllLocks = new ToolStripMenuItem("Remove All Locks"); _itemRemoveAllLocks.Click += (sender, e) => WatchVariableLockManager.RemoveAllLocks(); ToolStripMenuItem itemCopyUnrounded = new ToolStripMenuItem("Copy"); itemCopyUnrounded.Click += (sender, e) => Clipboard.SetText( GetValue(false, true, _watchVarControl.FixedAddressList).ToString()); ToolStripMenuItem itemPaste = new ToolStripMenuItem("Paste"); itemPaste.Click += (sender, e) => _watchVarControl.SetValue(Clipboard.GetText()); _contextMenuStrip.AddToBeginningList(_itemHighlight); _contextMenuStrip.AddToBeginningList(_itemLock); _contextMenuStrip.AddToBeginningList(_itemRemoveAllLocks); _contextMenuStrip.AddToBeginningList(itemCopyUnrounded); _contextMenuStrip.AddToBeginningList(itemPaste); }
private void AddContextMenuStripItems() { _itemHighlight = new ToolStripMenuItem("Highlight"); _itemHighlight.Click += (sender, e) => _watchVarControl.ToggleHighlighted(); _itemHighlight.Checked = _watchVarControl.Highlighted; _itemLock = new ToolStripMenuItem("Lock"); _itemLock.Click += (sender, e) => ToggleLocked(null, _watchVarControl.FixedAddressListGetter()); ToolStripMenuItem itemCopyUnrounded = new ToolStripMenuItem("Copy"); itemCopyUnrounded.Click += (sender, e) => { Clipboard.SetText(GetValue(false, true, _watchVarControl.FixedAddressListGetter()).ToString()); _watchVarControl.FlashColor(WatchVariableControl.COPY_COLOR); }; ToolStripMenuItem itemPaste = new ToolStripMenuItem("Paste"); itemPaste.Click += (sender, e) => Paste(); _contextMenuStrip.AddToBeginningList(_itemHighlight); _contextMenuStrip.AddToBeginningList(_itemLock); _contextMenuStrip.AddToBeginningList(itemCopyUnrounded); _contextMenuStrip.AddToBeginningList(itemPaste); }