static void Main(string[] args) { Biblioteca miBiblioteca = 5; Autor a = new Autor("Esteban", "Rey"); Autor b = new Autor("Joe", "Mayo"); Manual m1 = new Manual("Economia", "Domingo", "Caballo", 25f, ETipo.Finanzas); Novela n1 = new Novela("Miseria", 63.50f, a, EGenero.Romantica); Manual m2 = new Manual("C#", "Joe", "Mayo", 299.50f, ETipo.Tecnico); Novela n2 = new Novela("Miseria", 205f, a, EGenero.Accion); Novela n3 = new Novela("Miseria", 98f, a, EGenero.CienciaFiccion); Novela n4 = new Novela("Miseria", 103.50f, b, EGenero.Accion); miBiblioteca += m1; //YA INGRESADO miBiblioteca += m1; miBiblioteca += n1; miBiblioteca += m2; miBiblioteca += n2; miBiblioteca += n3; //SIN LUGAR miBiblioteca += n4; Console.WriteLine(); //TRUE Console.WriteLine(m1.Equals(m1)); //FALSE Console.WriteLine(m1.Equals("Joe Mayo")); //FALSE Console.WriteLine(m1.Equals(m2)); //FALSE Console.WriteLine(n1.Equals(n1)); //TRUE Console.WriteLine(n1.Equals(n2)); //FALSE Console.WriteLine(n1.Equals(n4)); Console.WriteLine(Biblioteca.Mostrar(miBiblioteca)); Console.ReadLine(); }
/// <summary> /// Returns true if SummaryActivity instances are equal /// </summary> /// <param name="other">Instance of SummaryActivity to be compared</param> /// <returns>Boolean</returns> public bool Equals(SummaryActivity other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( ExternalId == other.ExternalId || ExternalId != null && ExternalId.Equals(other.ExternalId) ) && ( UploadId == other.UploadId || UploadId != null && UploadId.Equals(other.UploadId) ) && ( Athlete == other.Athlete || Athlete != null && Athlete.Equals(other.Athlete) ) && ( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( Distance == other.Distance || Distance != null && Distance.Equals(other.Distance) ) && ( MovingTime == other.MovingTime || MovingTime != null && MovingTime.Equals(other.MovingTime) ) && ( ElapsedTime == other.ElapsedTime || ElapsedTime != null && ElapsedTime.Equals(other.ElapsedTime) ) && ( TotalElevationGain == other.TotalElevationGain || TotalElevationGain != null && TotalElevationGain.Equals(other.TotalElevationGain) ) && ( ElevHigh == other.ElevHigh || ElevHigh != null && ElevHigh.Equals(other.ElevHigh) ) && ( ElevLow == other.ElevLow || ElevLow != null && ElevLow.Equals(other.ElevLow) ) && ( Type == other.Type || Type != null && Type.Equals(other.Type) ) && ( StartDate == other.StartDate || StartDate != null && StartDate.Equals(other.StartDate) ) && ( StartDateLocal == other.StartDateLocal || StartDateLocal != null && StartDateLocal.Equals(other.StartDateLocal) ) && ( Timezone == other.Timezone || Timezone != null && Timezone.Equals(other.Timezone) ) && ( StartLatlng == other.StartLatlng || StartLatlng != null && StartLatlng.Equals(other.StartLatlng) ) && ( EndLatlng == other.EndLatlng || EndLatlng != null && EndLatlng.Equals(other.EndLatlng) ) && ( AchievementCount == other.AchievementCount || AchievementCount != null && AchievementCount.Equals(other.AchievementCount) ) && ( KudosCount == other.KudosCount || KudosCount != null && KudosCount.Equals(other.KudosCount) ) && ( CommentCount == other.CommentCount || CommentCount != null && CommentCount.Equals(other.CommentCount) ) && ( AthleteCount == other.AthleteCount || AthleteCount != null && AthleteCount.Equals(other.AthleteCount) ) && ( PhotoCount == other.PhotoCount || PhotoCount != null && PhotoCount.Equals(other.PhotoCount) ) && ( TotalPhotoCount == other.TotalPhotoCount || TotalPhotoCount != null && TotalPhotoCount.Equals(other.TotalPhotoCount) ) && ( Map == other.Map || Map != null && Map.Equals(other.Map) ) && ( Trainer == other.Trainer || Trainer != null && Trainer.Equals(other.Trainer) ) && ( Commute == other.Commute || Commute != null && Commute.Equals(other.Commute) ) && ( Manual == other.Manual || Manual != null && Manual.Equals(other.Manual) ) && ( _Private == other._Private || _Private != null && _Private.Equals(other._Private) ) && ( Flagged == other.Flagged || Flagged != null && Flagged.Equals(other.Flagged) ) && ( WorkoutType == other.WorkoutType || WorkoutType != null && WorkoutType.Equals(other.WorkoutType) ) && ( UploadIdStr == other.UploadIdStr || UploadIdStr != null && UploadIdStr.Equals(other.UploadIdStr) ) && ( AverageSpeed == other.AverageSpeed || AverageSpeed != null && AverageSpeed.Equals(other.AverageSpeed) ) && ( MaxSpeed == other.MaxSpeed || MaxSpeed != null && MaxSpeed.Equals(other.MaxSpeed) ) && ( HasKudoed == other.HasKudoed || HasKudoed != null && HasKudoed.Equals(other.HasKudoed) ) && ( HideFromHome == other.HideFromHome || HideFromHome != null && HideFromHome.Equals(other.HideFromHome) ) && ( GearId == other.GearId || GearId != null && GearId.Equals(other.GearId) ) && ( Kilojoules == other.Kilojoules || Kilojoules != null && Kilojoules.Equals(other.Kilojoules) ) && ( AverageWatts == other.AverageWatts || AverageWatts != null && AverageWatts.Equals(other.AverageWatts) ) && ( DeviceWatts == other.DeviceWatts || DeviceWatts != null && DeviceWatts.Equals(other.DeviceWatts) ) && ( MaxWatts == other.MaxWatts || MaxWatts != null && MaxWatts.Equals(other.MaxWatts) ) && ( WeightedAverageWatts == other.WeightedAverageWatts || WeightedAverageWatts != null && WeightedAverageWatts.Equals(other.WeightedAverageWatts) )); }