public MixedCodeDataModel(MixedCodeDataModel that) { this.program = that.program; this.curPos = that.curPos; this.endPos = that.endPos; this.instructions = that.instructions; this.LineCount = that.LineCount; }
private void RefreshModel() { var currentPos = Model.CurrentPosition; var model = new MixedCodeDataModel(program); model.MoveToLine(currentPos, 0); currentPos = Model.CurrentPosition; this.addrTop = MixedCodeDataModel.PositionAddress(currentPos); this.Model = model; }
public Address GetAnchorAddress() { var pt = GetAnchorMiddlePoint(); var memoryTextSpan = GetTagFromPoint(pt) as MixedCodeDataModel.MemoryTextSpan; if (memoryTextSpan == null || memoryTextSpan.Address == null) { return(MixedCodeDataModel.PositionAddress(anchorPos.Line)); } return(memoryTextSpan.Address); }
private void OnTopAddressChanged() { if (program != null) { var addrTopPos = MixedCodeDataModel.Position(addrTop, 0); Model.MoveToLine(addrTopPos, 0); RecomputeLayout(); UpdateScrollbar(); Invalidate(); } }
public MixedCodeDataModel(MixedCodeDataModel that) { this.program = that.program; this.imageMap = that.imageMap; this.curPos = that.curPos; this.StartPosition = that.StartPosition; this.endPos = that.endPos; this.instructions = that.instructions; this.LineCount = that.LineCount; this.comments = that.comments; }
protected override void OnScroll() { if (Model is MixedCodeDataModel) { var currentPos = Model.CurrentPosition; addrTop = MixedCodeDataModel.PositionAddress(currentPos); } else { addrTop = null; } base.OnScroll(); }
private void OnProgramChanged() { try { if (program != null) { Model = new MixedCodeDataModel(program); var currentPos = Model.CurrentPosition; addrTop = MixedCodeDataModel.PositionAddress(currentPos); return; } } catch (Exception ex) { Services.RequireService <IDiagnosticsService>().Error(ex, "An error occurred while displaying the program."); } Model = new EmptyEditorModel(); addrTop = null; }