public void FindMatch(SearchParameters options) { int activeEditorIndex = mWordEditorList.ActiveEditorIndex; IWordEditor activeEditor = activeEditorIndex >= 0 ? mWordEditorList[activeEditorIndex] : null; if (activeEditor != null) { options.SearchFromWordIndex = ((IMemoryFullWord)activeEditor.WordValue).Index; options.SearchFromField = activeEditor.FocusedField ?? FieldTypes.None; options.SearchFromFieldIndex = options.SearchFromField != FieldTypes.None ? activeEditor.CaretIndex ?? 0 : 0; } else { if (mWordEditorList.FirstVisibleIndex > options.SearchFromWordIndex || mWordEditorList.FirstVisibleIndex + mWordEditorList.VisibleEditorCount <= options.SearchFromWordIndex) { options.SearchFromWordIndex = mWordEditorList.FirstVisibleIndex; } options.SearchFromField = FieldTypes.None; options.SearchFromFieldIndex = 0; } var result = mMemory.FindMatch(options); if (result != null) { MakeAddressVisible(result.WordIndex); activeEditor = mWordEditorList[result.WordIndex - mWordEditorList.FirstVisibleIndex]; activeEditor.Focus(result.Field, result.FieldIndex); activeEditor.Select(result.FieldIndex, options.SearchText.Length); } else { MessageBox.Show(this, string.Format("Search text \"{0}\" could not be found.", options.SearchText), "Text not found", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
void LoadWordEditor(IWordEditor editor, int index) { var deviceEditor = (DeviceWordEditor)editor; deviceEditor.DeviceWord = index >= 0 ? mRecordEditWords[index] : new FullWord(0L); deviceEditor.WordIndex = index; }
void LoadWordEditor(IWordEditor editor, int address) { var memoryEditor = (MemoryWordEditor)editor; if (address == memoryEditor.MemoryWord.Index && address >= mMemory.MinWordIndex && memoryEditor.MemoryWord.Equals(mMemory[address])) { memoryEditor.Update(); } else { memoryEditor.MemoryWord = address >= mMemory.MinWordIndex ? mMemory[address] : new MemoryFullWord(address); } memoryEditor.BreakPointChecked = mBreakpoints.Contains(address); memoryEditor.Marked = mMarkedAddress == address; }
void Editor_ValueChanged(IWordEditor sender, Events.WordEditorValueChangedEventArgs args) { ChangesPending = true; }
void WordEditor_ValueChanged(IWordEditor sender, WordEditorValueChangedEventArgs args) { mLongValueTextBox.Magnitude = mWordEditor.WordValue.MagnitudeLongValue; mLongValueTextBox.Sign = mWordEditor.WordValue.Sign; OnValueChanged(args); }
void MWordValueEditor_ValueChanged(IWordEditor sender, WordEditorValueChangedEventArgs args) { mWordCharTextBox.Update(); OnValueChanged(args); }
void MFullWordEditor_ValueChanged(IWordEditor sender, WordEditorValueChangedEventArgs args) => OnValueChanged(args);
void MFullWordEditor_ValueChanged(IWordEditor sender, WordEditorValueChangedEventArgs args) { mInstructionTextBox.Update(); OnValueChanged(args); }