@@ -7,94 +7,94 @@ namespace Geocoding;
77/// </summary>
88public class Bounds
99{
10- readonly Location southWest ;
11- readonly Location northEast ;
10+ readonly Location southWest ;
11+ readonly Location northEast ;
1212
13- /// <summary>
14- /// Gets the southwest corner.
15- /// </summary>
16- public Location SouthWest
17- {
18- get { return southWest ; }
19- }
13+ /// <summary>
14+ /// Gets the southwest corner.
15+ /// </summary>
16+ public Location SouthWest
17+ {
18+ get { return southWest ; }
19+ }
2020
21- /// <summary>
22- /// Gets the northeast corner.
23- /// </summary>
24- public Location NorthEast
25- {
26- get { return northEast ; }
27- }
21+ /// <summary>
22+ /// Gets the northeast corner.
23+ /// </summary>
24+ public Location NorthEast
25+ {
26+ get { return northEast ; }
27+ }
2828
29- /// <summary>
30- /// Initializes bounds from raw latitude and longitude values.
31- /// </summary>
32- /// <param name="southWestLatitude">The southwest latitude.</param>
33- /// <param name="southWestLongitude">The southwest longitude.</param>
34- /// <param name="northEastLatitude">The northeast latitude.</param>
35- /// <param name="northEastLongitude">The northeast longitude.</param>
36- public Bounds ( double southWestLatitude , double southWestLongitude , double northEastLatitude , double northEastLongitude )
37- : this ( new Location ( southWestLatitude , southWestLongitude ) , new Location ( northEastLatitude , northEastLongitude ) ) { }
29+ /// <summary>
30+ /// Initializes bounds from raw latitude and longitude values.
31+ /// </summary>
32+ /// <param name="southWestLatitude">The southwest latitude.</param>
33+ /// <param name="southWestLongitude">The southwest longitude.</param>
34+ /// <param name="northEastLatitude">The northeast latitude.</param>
35+ /// <param name="northEastLongitude">The northeast longitude.</param>
36+ public Bounds ( double southWestLatitude , double southWestLongitude , double northEastLatitude , double northEastLongitude )
37+ : this ( new Location ( southWestLatitude , southWestLongitude ) , new Location ( northEastLatitude , northEastLongitude ) ) { }
3838
39- /// <summary>
40- /// Initializes bounds from two corner locations.
41- /// </summary>
42- /// <param name="southWest">The southwest corner.</param>
43- /// <param name="northEast">The northeast corner.</param>
44- [ JsonConstructor ]
45- public Bounds ( Location southWest , Location northEast )
46- {
47- if ( southWest == null )
48- throw new ArgumentNullException ( "southWest" ) ;
39+ /// <summary>
40+ /// Initializes bounds from two corner locations.
41+ /// </summary>
42+ /// <param name="southWest">The southwest corner.</param>
43+ /// <param name="northEast">The northeast corner.</param>
44+ [ JsonConstructor ]
45+ public Bounds ( Location southWest , Location northEast )
46+ {
47+ if ( southWest == null )
48+ throw new ArgumentNullException ( "southWest" ) ;
4949
50- if ( northEast == null )
51- throw new ArgumentNullException ( "northEast" ) ;
50+ if ( northEast == null )
51+ throw new ArgumentNullException ( "northEast" ) ;
5252
53- if ( southWest . Latitude > northEast . Latitude )
54- throw new ArgumentException ( "southWest latitude cannot be greater than northEast latitude" ) ;
53+ if ( southWest . Latitude > northEast . Latitude )
54+ throw new ArgumentException ( "southWest latitude cannot be greater than northEast latitude" ) ;
5555
56- this . southWest = southWest ;
57- this . northEast = northEast ;
58- }
56+ this . southWest = southWest ;
57+ this . northEast = northEast ;
58+ }
5959
60- /// <summary>
61- /// Determines whether the specified object is equal to the current bounds.
62- /// </summary>
63- /// <param name="obj">The object to compare.</param>
64- /// <returns><c>true</c> when equal; otherwise <c>false</c>.</returns>
65- public override bool Equals ( object obj )
66- {
67- return Equals ( obj as Bounds ) ;
68- }
60+ /// <summary>
61+ /// Determines whether the specified object is equal to the current bounds.
62+ /// </summary>
63+ /// <param name="obj">The object to compare.</param>
64+ /// <returns><c>true</c> when equal; otherwise <c>false</c>.</returns>
65+ public override bool Equals ( object obj )
66+ {
67+ return Equals ( obj as Bounds ) ;
68+ }
6969
70- /// <summary>
71- /// Determines whether another bounds instance is equal to the current one.
72- /// </summary>
73- /// <param name="bounds">The other bounds instance.</param>
74- /// <returns><c>true</c> when equal; otherwise <c>false</c>.</returns>
75- public bool Equals ( Bounds bounds )
76- {
77- if ( bounds == null )
78- return false ;
70+ /// <summary>
71+ /// Determines whether another bounds instance is equal to the current one.
72+ /// </summary>
73+ /// <param name="bounds">The other bounds instance.</param>
74+ /// <returns><c>true</c> when equal; otherwise <c>false</c>.</returns>
75+ public bool Equals ( Bounds bounds )
76+ {
77+ if ( bounds == null )
78+ return false ;
7979
80- return ( this . SouthWest . Equals ( bounds . SouthWest ) && this . NorthEast . Equals ( bounds . NorthEast ) ) ;
81- }
80+ return ( this . SouthWest . Equals ( bounds . SouthWest ) && this . NorthEast . Equals ( bounds . NorthEast ) ) ;
81+ }
8282
83- /// <summary>
84- /// Returns a hash code for the current bounds.
85- /// </summary>
86- /// <returns>A hash code for the current bounds.</returns>
87- public override int GetHashCode ( )
88- {
89- return SouthWest . GetHashCode ( ) ^ NorthEast . GetHashCode ( ) ;
90- }
83+ /// <summary>
84+ /// Returns a hash code for the current bounds.
85+ /// </summary>
86+ /// <returns>A hash code for the current bounds.</returns>
87+ public override int GetHashCode ( )
88+ {
89+ return SouthWest . GetHashCode ( ) ^ NorthEast . GetHashCode ( ) ;
90+ }
9191
92- /// <summary>
93- /// Returns a string representation of the bounds.
94- /// </summary>
95- /// <returns>A string representation of the bounds.</returns>
96- public override string ToString ( )
97- {
98- return string . Format ( "{0} | {1}" , southWest , northEast ) ;
99- }
100- }
92+ /// <summary>
93+ /// Returns a string representation of the bounds.
94+ /// </summary>
95+ /// <returns>A string representation of the bounds.</returns>
96+ public override string ToString ( )
97+ {
98+ return string . Format ( "{0} | {1}" , southWest , northEast ) ;
99+ }
100+ }
0 commit comments