/// <summary> /// Add a new frequency. /// </summary> /// <param name="newFrequency">The frequency to be added.</param> public void AddFrequency(ISDBSatelliteFrequency newFrequency) { foreach (ISDBSatelliteFrequency oldFrequency in Frequencies) { if (oldFrequency.Frequency == newFrequency.Frequency) { if (oldFrequency.Polarization == newFrequency.Polarization) { return; } else { if (oldFrequency.Polarization.PolarizationAbbreviation.CompareTo(newFrequency.Polarization.PolarizationAbbreviation) > 0) { Frequencies.Insert(Frequencies.IndexOf(oldFrequency), newFrequency); return; } } } if (oldFrequency.Frequency > newFrequency.Frequency) { Frequencies.Insert(Frequencies.IndexOf(oldFrequency), newFrequency); return; } } Frequencies.Add(newFrequency); }