2
// <copyright see="prj:///doc/copyright.txt"/>
3
// <license see="prj:///doc/license.txt"/>
4
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
5
// <version>$Revision: 4482 $</version>
10
namespace ICSharpCode.OldNRefactory
13
/// A line/column position.
14
/// NRefactory lines/columns are counting from one.
16
public struct Location : IComparable<Location>, IEquatable<Location>
18
public static readonly Location Empty = new Location(-1, -1);
20
public Location(int column, int line)
50
return x <= 0 && y <= 0;
54
public override string ToString()
56
return string.Format("(Line {1}, Col {0})", this.x, this.y);
59
public override int GetHashCode()
61
return unchecked (87 * x.GetHashCode() ^ y.GetHashCode());
64
public override bool Equals(object obj)
66
if (!(obj is Location)) return false;
67
return (Location)obj == this;
70
public bool Equals(Location other)
75
public static bool operator ==(Location a, Location b)
77
return a.x == b.x && a.y == b.y;
80
public static bool operator !=(Location a, Location b)
82
return a.x != b.x || a.y != b.y;
85
public static bool operator <(Location a, Location b)
95
public static bool operator >(Location a, Location b)
105
public static bool operator <=(Location a, Location b)
110
public static bool operator >=(Location a, Location b)
115
public int CompareTo(Location other)