Beispiel #1
0
        private void OnMenuStripClick(object sender, ToolStripItemClickedEventArgs e)
        {
            if (this != _lastSelected)
            {
                return;
            }

            switch (e.ClickedItem.Text)
            {
            case "Edit":
                EditMode = true;
                break;

            case "View As Hexadecimal":
                _watchVar.UseHex = !(e.ClickedItem as ToolStripMenuItem).Checked;
                (e.ClickedItem as ToolStripMenuItem).Checked = !(e.ClickedItem as ToolStripMenuItem).Checked;
                break;

            case "Lock Value":
                EditMode = false;
                (e.ClickedItem as ToolStripMenuItem).Checked = !(e.ClickedItem as ToolStripMenuItem).Checked;
                if (OffsetList.Any(o => GetIsLocked(o)))
                {
                    OffsetList.ForEach(o => RemoveLock(o));
                }
                else
                {
                    OffsetList.ForEach(o => LockUpdate(o));
                }
                break;

            case "Select Object":
                if (_watchVar.ByteCount != 4)
                {
                    return;
                }

                var slotManager = ManagerContext.Current.ObjectSlotManager;
                slotManager.SelectedSlotsAddresses.Clear();
                foreach (var otherOffset in OffsetList)
                {
                    var objAddress = BitConverter.ToUInt32(_watchVar.GetByteData(otherOffset), 0);
                    if (ManagerContext.Current.ObjectSlotManager.ObjectSlots.Count(s => s.Address == objAddress) > 0)
                    {
                        slotManager.SelectedSlotsAddresses.Add(objAddress);
                    }
                }
                break;

            case "Highlight":
                var toolItem = (e.ClickedItem as ToolStripMenuItem);
                toolItem.Checked       = !toolItem.Checked;
                _tablePanel.ShowBorder = toolItem.Checked;
                break;
            }
        }