/// <summary> /// Returns true if this object equals the value passed in. /// </summary> /// <param name="s">Other object to compare to.</param> /// <returns>True if this == obj, false otherwise.</returns> public bool Equals(Showtime s) { // Return true if all fields match: return(MovieTitle.Equals(s.MovieTitle) && Theater.Equals(s.Theater) && Time.Equals(s.Time)); }
/// <summary> /// Returns true if this object equals the value passed in. /// </summary> /// <param name="obj">Other object to compare to.</param> /// <returns>True if this == obj, false otherwise.</returns> public override bool Equals(Object obj) { // If parameter cannot be cast to ThreeDPoint return false: Showtime s = obj as Showtime; if (s == null) { return(false); } return(Equals(s)); }