static void Main(string[] args) { var stations = new StationList(); var station1 = new RadioStation(89); stations.Add(station1); var station2 = new RadioStation(101); stations.Add(station2); var station3 = new RadioStation(102); stations.Add(station3); foreach (var x in stations) { Console.Write(x.GetFrequecy()); } var q = stations.Where(x => x.GetFrequecy() == 89).FirstOrDefault(); Console.WriteLine(q.GetFrequecy()); Console.ReadLine(); }
static void Main(string[] args) { var stations = new StationList(); var station1 = new RadioStation(89); stations.AddStation(station1); var station2 = new RadioStation(101); stations.AddStation(station2); var station3 = new RadioStation(102); stations.AddStation(station3); foreach (RadioStation station in stations) { Console.WriteLine(station.GetFrequecy()); } stations.RemoveStation(station2); // Will Remove station 101 Console.ReadLine(); }
public void RemoveStation(RadioStation station) { mStations.Remove(station); }
public void AddStation(RadioStation station) { mStations.Add(station); }