コード例 #1
0
ファイル: Area.cs プロジェクト: dvv153m/ScoutOnlineCode
 public override int GetHashCode()
 {
     unchecked
     {
         var result = NorthLatitude.GetHashCode();
         result = (result * 397) ^ WestLongitude.GetHashCode();
         result = (result * 397) ^ SouthLatitude.GetHashCode();
         result = (result * 397) ^ EastLongitude.GetHashCode();
         return(result);
     }
 }
コード例 #2
0
        public int CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }

            BoundingBox otherBox = obj as BoundingBox;

            if (otherBox != null)
            {
                var comparer = SouthLatitude.CompareTo(otherBox.SouthLatitude);
                if (comparer == 0)
                {
                    comparer = WestLongitude.CompareTo(otherBox.WestLongitude);
                }
                return(comparer);
            }
            else
            {
                throw new ArgumentException("Object is not a BoundingBox");
            }
        }