-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathEdit.cs
58 lines (41 loc) · 1.12 KB
/
Edit.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
namespace Menees.Diffs
{
#region Using Directives
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
#endregion
[DebuggerDisplay("Type = {EditType}, StartA = {StartA}, StartB = {StartB}, Length = {Length}")]
public sealed class Edit
{
#region Private Data Members
private readonly EditType editType;
private readonly int length;
private int startA; // Where to Delete, Insert, or Change in the "A" sequence
private int startB; // Where to Insert or Change in the "B" sequence
#endregion
#region Constructors
internal Edit(EditType editType, int startA, int startB, int length)
{
this.editType = editType;
this.startA = startA;
this.startB = startB;
this.length = length;
}
#endregion
#region Public Properties
public int Length => this.length;
public int StartA => this.startA;
public int StartB => this.startB;
public EditType EditType => this.editType;
#endregion
#region Public Methods
public void Offset(int offsetA, int offsetB)
{
this.startA += offsetA;
this.startB += offsetB;
}
#endregion
}
}