public async Task SetPositions( XmlNode startNode, XmlCursorPositions posAtStartNode, int textPosInStartNode, XmlNode endNode, XmlCursorPositions posAtEndNode, int textPosInEndNode, bool throwChangedEventWhenValuesChanged) { var changed = false; if (throwChangedEventWhenValuesChanged) { changed = (startNode != this.StartPos.ActualNode || posAtStartNode != this.StartPos.PosOnNode || textPosInStartNode != this.StartPos.PosInTextNode || endNode != this.EndPos.ActualNode || posAtEndNode != this.EndPos.PosOnNode || textPosInEndNode != this.EndPos.PosInTextNode); } this.StartPos.SetPos(startNode, posAtStartNode, textPosInStartNode); this.EndPos.SetPos(endNode, posAtEndNode, textPosInEndNode); if (changed) { await ChangedEvent.Trigger(EventArgs.Empty); } }