Exemplo n.º 1
0
        public void SetCommandAtIndex(int index, RelCommand cmd)
        {
            if (index >= _relocations.Count || index < 0)
            {
                return;
            }

            if (_relocations[index].Command != null)
            {
                _relocations[index].Command.Remove();
            }

            _relocations[index].Command = cmd;

            RelCommand c = GetCommandBefore(index);

            if (c != null)
            {
                cmd.InsertAfter(c);
            }
            else
            {
                c = GetCommandAfter(index);
                if (c != null)
                {
                    cmd.InsertBefore(c);
                }
            }
            GetFirstCommand();
        }
        private void btnOpenTarget_Click(object sender, EventArgs e)
        {
            RelCommand cmd = _manager.GetCommand(SelectedRelocationIndex);

            if (cmd != null)
            {
                OpenRelocation(cmd.GetTargetRelocation());
            }
        }
Exemplo n.º 3
0
        public void ClearCommands()
        {
            RelCommand c = _firstCommand;

            while (c != null)
            {
                c._parentRelocation.Command = null;
                c = c._next;
            }
        }
        private void btnNewCmd_Click(object sender, EventArgs e)
        {
            RelCommand cmd = new RelCommand(
                (_section.Root as ModuleNode).ID,
                _section,
                new RELLink());

            _manager.SetCommand(SelectedRelocationIndex, cmd);

            CommandChanged();
            hexBox1.Focus();
            _relocationsChanged = true;
        }
Exemplo n.º 5
0
        private void btnNewCmd_Click(object sender, EventArgs e)
        {
            RelCommand cmd = new RelCommand(
                (_section.Root as ModuleNode).ID,
                _section,
                new RELLink());

            if (hexBox1.SelectionLength > 0)
            {
                for (int i = 0; i < (hexBox1.SelectionLength.RoundUp(4) / 4); i++)
                {
                    _manager.SetCommand(SelectedRelocationIndex + i, cmd);
                }
            }
            else
            {
                _manager.SetCommand(SelectedRelocationIndex, cmd);
            }

            CommandChanged();
            hexBox1.Focus();
            _relocationsChanged = true;
        }
Exemplo n.º 6
0
 public void SetCommandAtOffset(int offset, RelCommand cmd)
 {
     SetCommandAtIndex(offset.RoundDown(4) / 4, cmd);
 }
Exemplo n.º 7
0
 public void GetFirstCommand()
 {
     _firstCommand = GetCommandAfter(-1);
 }