public static bool ArePositionsEqual( Position x, Position y ) { if ( ReferenceEquals( x, y ) ) // returns true also if both are null return true; // at this point at least one is not null because of ReferenceEquals above. if ( x == null || y == null ) return false; // so now both are not nulls and different instances. return EqualityExpression( x, y ); }
protected TrackerState( Data.Position position, Data.Error error, string tag ) { if ( position == null && error == null ) throw new ArgumentException( "At least one parameter should be not null" ); Position = position; Error = error; Tag = tag; }
/// <summary> /// Makes an instance with the lat and lon found in the response from the foreign web server. /// </summary> /// <param name="fullTrack">Not null, not empty value (i.e. with at least one element).</param> /// <param name="tag">Debug string specific to the foreign system, see also <see cref="Tag"/> for details.</param> public TrackerState( IEnumerable<Data.TrackPointData> fullTrack, string tag ) { Position = new Data.Position( fullTrack ); Tag = tag; }