/// <summary> /// Initializes a new instance of the <see cref="Segment"/> class /// with the provided splice identifier, offset, text, extent and deletions. /// </summary> /// <param name="spliceId">Splice identifier</param> /// <param name="offset">Text offset</param> /// <param name="text">Segment text</param> /// <param name="extent">Text extent</param> /// <param name="deletions">Text deletions</param> public Segment(SpliceId spliceId, Point offset, string text, Point extent, HashSet <SpliceId> deletions) { SpliceId = spliceId; Offset = offset; Text = text; Extent = extent; Deletions = deletions ?? throw new ArgumentNullException(nameof(deletions)); }
/// <summary> /// Initializes a new instance of the <see cref="TextInsertionModification"/> class /// with the provided text, identifiers of start and end splices as well as the respective /// character offsets. /// </summary> /// <param name="text">Inserted text</param> /// <param name="leftDependencyId">Identifier of the splice where modification starts</param> /// <param name="offsetInLeftDependency">Character offset in the starting splice</param> /// <param name="rightDependencyId">Identifier of the splice where modification ends</param> /// <param name="offsetInRightDependency">Character offset in the ending splice</param> public TextInsertionModification( string text, SpliceId leftDependencyId, Point offsetInLeftDependency, SpliceId rightDependencyId, Point offsetInRightDependency) : base(leftDependencyId, offsetInLeftDependency, rightDependencyId, offsetInRightDependency) { Text = text; }
/// <summary> /// Initializes a new instance of the <see cref="TextModificationBase"/> class /// with the provided identifiers of start and end splices as well as the respective /// character offsets. /// </summary> /// <param name="leftDependencyId">Identifier of the splice where modification starts</param> /// <param name="offsetInLeftDependency">Character offset in the starting splice</param> /// <param name="rightDependencyId">Identifier of the splice where modification ends</param> /// <param name="offsetInRightDependency">Character offset in the ending splice</param> public TextModificationBase( SpliceId leftDependencyId, Point offsetInLeftDependency, SpliceId rightDependencyId, Point offsetInRightDependency) { LeftDependencyId = leftDependencyId; OffsetInLeftDependency = offsetInLeftDependency; RightDependencyId = rightDependencyId; OffsetInRightDependency = offsetInRightDependency; }
/// <summary> /// Initializes a new instance of the <see cref="LogicalRange"/> class /// with the provided start and end logical position. /// </summary> /// <param name="startDependencyId">Identifier of the splice where range starts</param> /// <param name="offsetInStartDependency">Character offset in the splice where range starts</param> /// <param name="endDependencyId">Identifier of the splice where range ends</param> /// <param name="offsetInEndDependency">Character offset in the splice where range ends</param> public LogicalRange( SpliceId startDependencyId, Point offsetInStartDependency, SpliceId endDependencyId, Point offsetInEndDependency) { StartDependencyId = startDependencyId; OffsetInStartDependency = offsetInStartDependency; EndDependencyId = endDependencyId; OffsetInEndDependency = offsetInEndDependency; }
/// <summary> /// Initializes a new instance of the <see cref="SpliceOperation"/> class /// with the provided splice identifiert, deletion and insertion modifications. /// </summary> /// <param name="spliceId">Splice identifier for this operation</param> /// <param name="deletion">Text deletion modification</param> /// <param name="insertion">Text insertion modification</param> public SpliceOperation(SpliceId spliceId, TextDeletionModification deletion, TextInsertionModification insertion) { SpliceId = spliceId; Deletion = deletion; Insertion = insertion; }
/// <summary> /// Initializes a new instance of the <see cref="Segment"/> class /// with the provided splice identifier, offset, text and extent. /// </summary> /// <param name="spliceId">Splice identifier</param> /// <param name="offset">Text offset</param> /// <param name="text">Segment text</param> /// <param name="extent">Text extent</param> public Segment(SpliceId spliceId, Point offset, string text, Point extent) : this(spliceId, offset, text, extent, new HashSet <SpliceId>()) { }
/// <summary> /// Initializes a new isntance of the <see cref="UndoOperation"/> class /// with the provided splice identifier and number of undo actions. /// </summary> /// <param name="spliceId">Splice identifier of the last undone operation</param> /// <param name="undoCount">Number of undo actions</param> public UndoOperation(SpliceId spliceId, int undoCount) { SpliceId = spliceId; UndoCount = undoCount; }