public void OpenRelocation(RelocationTarget target) { if (target == null) { return; } if (target._sectionID != _section.Index) { foreach (SectionEditor r in _openedSections) { if (r._section.Index == target._sectionID) { r.Position = target._index * 4; r.Focus(); r.hexBox1.Focus(); return; } } //TODO: use target module id here ModuleSectionNode section = ((ModuleNode)_section.Root).Sections[target._sectionID]; SectionEditor x = new SectionEditor(section); x.Show(); x.Position = target._index * 4; x.hexBox1.Focus(); } else { Position = target._index * 4; hexBox1.Focus(); } }
private void lstLinked_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); if (e.Index >= 0) { RelocationTarget r = lstLinked.Items[e.Index] as RelocationTarget; if (r != null && r.Section != null) { PPCOpCode code = r.Section._manager.GetCode(r._index); Color c = code is PPCBranch ? Color.Blue : Color.Red; e.Graphics.DrawString(r.ToString(), lstLinked.Font, new SolidBrush(c), e.Bounds); } } e.DrawFocusRectangle(); }