public Boolean IsEqual(PopulationServiceEvent compareEvent) { Boolean isEqual = true; if (this.serviceId != compareEvent.ServiceId) { isEqual = false; } if (this.exclusionServiceId != compareEvent.ExclusionServiceId) { isEqual = false; } if (this.anchorDate != compareEvent.AnchorDate) { isEqual = false; } if (this.anchorDateValue != compareEvent.AnchorDateValue) { isEqual = false; } if (this.reoccurring != compareEvent.Reoccurring) { isEqual = false; } if (this.scheduleDateValue != compareEvent.ScheduleDateValue) { isEqual = false; } if (this.scheduleDateQualifier != compareEvent.ScheduleDateQualifier) { isEqual = false; } if (isEqual) { foreach (PopulationServiceEventThreshold currentThreshold in thresholds) { if (!compareEvent.HasThreshold(currentThreshold)) { isEqual = false; break; } } } return(isEqual); }