Ejemplo n.º 1
0
        private void ShowAddDataRange()
        {
            var address = _disassemberDisplay.SelectedLine.HasValue
                ? _disassemberDisplay.SelectedLine.Value.Address
                : 0;

            var addRangeDialog = new AddDataRange(address, address + 1);

            addRangeDialog.StartPosition = FormStartPosition.CenterParent;
            var result = addRangeDialog.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                if (_trainer.MemoryMapManager.GetMemoryMap(addRangeDialog.StartAddress) != null)
                {
                    MessageBox.Show("The address range you selected already contains a memory map", "Add Memory Map", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                var memoryMap = new MemoryMap()
                {
                    Start       = addRangeDialog.StartAddress,
                    End         = addRangeDialog.EndAddress,
                    Type        = addRangeDialog.RangeType,
                    Description = addRangeDialog.Description
                };

                _trainer.MemoryMapManager.AddMemoryMap(memoryMap);
            }
        }
Ejemplo n.º 2
0
        private void AddRange()
        {
            if (_disassemberDisplay.SelectedLine.HasValue)
            {
                var addRangeDialog = new AddDataRange(_disassemberDisplay.SelectedLine.Value.Address, _disassemberDisplay.SelectedLine.Value.Address + 1);
                //addRangeDialog.Parent = this;
                addRangeDialog.StartPosition = FormStartPosition.CenterParent;
                var result = addRangeDialog.ShowDialog(this);
                if (result == DialogResult.OK)
                {
                    var memoryMap = new MemoryMap()
                    {
                        Start       = addRangeDialog.StartAddress,
                        End         = addRangeDialog.EndAddress,
                        Type        = addRangeDialog.RangeType,
                        Description = addRangeDialog.Description
                    };

                    _trainer.MemoryMapManager.AddMemoryMap(memoryMap);
                }
            }
        }