Browse Source

Add IsDeleted and Equals() implementation to IDocumentLine.

newNRvisualizers
Daniel Grunwald 15 years ago
parent
commit
dc98befcce
  1. 5
      ICSharpCode.NRefactory/Editor/IDocumentLine.cs
  2. 15
      ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs

5
ICSharpCode.NRefactory/Editor/IDocumentLine.cs

@ -51,5 +51,10 @@ namespace ICSharpCode.NRefactory.Editor @@ -51,5 +51,10 @@ namespace ICSharpCode.NRefactory.Editor
/// Gets the next line. Returns null if this is the last line in the document.
/// </summary>
IDocumentLine NextLine { get; }
/// <summary>
/// Gets whether the line was deleted.
/// </summary>
bool IsDeleted { get; }
}
}

15
ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs

@ -84,6 +84,17 @@ namespace ICSharpCode.NRefactory.Editor @@ -84,6 +84,17 @@ namespace ICSharpCode.NRefactory.Editor
this.endOffset = doc.GetEndOffset(lineNumber);
}
public override int GetHashCode()
{
return doc.GetHashCode() ^ lineNumber;
}
public override bool Equals(object obj)
{
ReadOnlyDocumentLine other = obj as ReadOnlyDocumentLine;
return other != null && doc == other.doc && lineNumber == other.lineNumber;
}
public int Offset {
get { return offset; }
}
@ -129,6 +140,10 @@ namespace ICSharpCode.NRefactory.Editor @@ -129,6 +140,10 @@ namespace ICSharpCode.NRefactory.Editor
return new ReadOnlyDocumentLine(doc, lineNumber + 1);
}
}
public bool IsDeleted {
get { return false; }
}
}
int GetStartOffset(int lineNumber)

Loading…
Cancel
Save