private void CodeView_PositionChanged() { var (node, numer, denom) = nestedTextModel.GetPositionAsNode(); var dataItemNode = nodeByAddress.Where(n => n.Value.ModelNode == node). Select(n => n.Value).SingleOrDefault(); long numLines = dataItemNode.NumLines; var offset = (int)((numLines * numer) / denom); var startAddr = dataItemNode.StartAddress; var startPos = MixedCodeDataModel.Position(startAddr, 0); combinedCodeView.MixedCodeDataView.Model.MoveToLine(startPos, offset); combinedCodeView.MixedCodeDataView.InvalidateModel(); }
private void CodeView_PositionChanged() { var pos = nestedTextModel.GetPositionAsNode(); var node = pos.Item1; var numer = pos.Item2; var denom = pos.Item3; var dataItemNode = nodeByAddress.Where(n => n.Value.ModelNode == node). Select(n => n.Value).SingleOrDefault(); long numLines = dataItemNode.NumLines; var offset = (int)((numLines * numer) / denom); combinedCodeView.MixedCodeDataView.Model.MoveToLine(dataItemNode.StartAddress, offset); combinedCodeView.MixedCodeDataView.InvalidateModel(); }