You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@@ -0,0 +1,55 @@
|
||||
// <copyright>
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace System.Activities.Debugger
|
||||
{
|
||||
using System.Diagnostics;
|
||||
|
||||
// Immutable, start and end always non-null.
|
||||
[DebuggerDisplay("({Start.LineNumber.Value}:{Start.LinePosition.Value}) - ({End.LineNumber.Value}:{End.LinePosition.Value})")]
|
||||
internal class DocumentRange : IEquatable<DocumentRange>
|
||||
{
|
||||
private DocumentLocation start;
|
||||
private DocumentLocation end;
|
||||
|
||||
internal DocumentRange(DocumentLocation start, DocumentLocation end)
|
||||
{
|
||||
UnitTestUtility.Assert(start != null, "DocumentRange.Start cannot be null");
|
||||
UnitTestUtility.Assert(end != null, "DocumentRange.End cannot be null");
|
||||
UnitTestUtility.Assert((start.LineNumber.Value < end.LineNumber.Value) || ((start.LineNumber.Value == end.LineNumber.Value) && (start.LinePosition.Value <= end.LinePosition.Value)), "Start cannot before go after End.");
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
internal DocumentRange(int startLineNumber, int startLinePosition, int endLineNumber, int endLinePosition)
|
||||
: this(new DocumentLocation(startLineNumber, startLinePosition), new DocumentLocation(endLineNumber, endLinePosition))
|
||||
{
|
||||
}
|
||||
|
||||
internal DocumentLocation Start
|
||||
{
|
||||
get { return this.start; }
|
||||
}
|
||||
|
||||
internal DocumentLocation End
|
||||
{
|
||||
get { return this.end; }
|
||||
}
|
||||
|
||||
public bool Equals(DocumentRange other)
|
||||
{
|
||||
if (other == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.Start.Equals(other.Start) && this.End.Equals(other.End);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return this.Start.GetHashCode() ^ this.End.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user