X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FMicrosoft.Build%2FMicrosoft.Build.Construction%2FElementLocation.cs;h=271029897218c81eb9d1a562cac5a734fa1c0c77;hb=468225a247b8897b2a4fa1e6bd7ffa32aa8c243b;hp=43f20dad9b6397a9cbdbc68a6cc601cf83ff35bb;hpb=e2b2d181084848f3c5dde2788370db1b79893c69;p=mono.git diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ElementLocation.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ElementLocation.cs index 43f20dad9b6..27102989721 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ElementLocation.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ElementLocation.cs @@ -1,10 +1,10 @@ // -// ProjectItemDefinitionInstance.cs +// ElementLocation.cs // // Author: -// Atsushi Enomoto (atsushi@veritas-vos-liberabit.com) +// Atsushi Enomoto (atsushi@xamarin.com) // -// Copyright (C) 2012 Xamarin Inc. +// Copyright (C) 2013 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_5 using Microsoft.Build.Framework; using System; @@ -35,7 +34,8 @@ using System.Collections.Generic; namespace Microsoft.Build.Construction { [Serializable] - public abstract class ElementLocation + public + abstract class ElementLocation { public abstract int Column { get; } public abstract string File { get; } @@ -44,7 +44,16 @@ namespace Microsoft.Build.Construction public string LocationString { get { return Line == 0 ? File : String.Format ("{0} ({1}{2})", File, Line, Column != 0 ? "," + Column : String.Empty); } } + + public override bool Equals (object other) + { + var o = other as ElementLocation; + return (object) o != null && o.File == File && o.Line == Line && o.Column == Column; + } + + public override int GetHashCode () + { + return (File.GetHashCode () << 16) + (Line << 8) + Column; + } } } - -#endif