public void UnSubscribe(IRdsSubscriber subscriber) { if (_subscribers.Contains(subscriber)) { _subscribers.Remove(subscriber); } }
public void Subscribe(IRdsSubscriber subscriber) { if (!_subscribers.Contains(subscriber)) { _subscribers.Add(subscriber); } }
public Car(string brand, string name, int engineVol, int tankVol, string bodyType, string countryOfOrigin) { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException("name is required."); } if (engineVol <= 0) { throw new ArgumentException("engineVol must be > 0."); } if (tankVol <= 0) { throw new ArgumentException("TankVol must be > 0."); } if (!bodyType.Any()) { throw new ArgumentException("Assign bodyType to a car."); } if (!countryOfOrigin.Any()) { throw new ArgumentException("Assign countryOfOrigin to a car."); } Brand = brand; Name = name; EngineVol = engineVol; TankVol = tankVol; BodyType = bodyType; CountryOfOrigin = countryOfOrigin; _receiver = new RdsReceiver(name); }
public Car(string brand, string name, int engineVol, int tankVol, string bodyType, string countryOfOrigin) { if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("name is required."); if (engineVol <= 0) throw new ArgumentException("engineVol must be > 0."); if (tankVol <= 0) throw new ArgumentException("TankVol must be > 0."); if (!bodyType.Any()) throw new ArgumentException("Assign bodyType to a car."); if (!countryOfOrigin.Any()) throw new ArgumentException("Assign countryOfOrigin to a car."); Brand = brand; Name = name; EngineVol = engineVol; TankVol = tankVol; BodyType = bodyType; CountryOfOrigin = countryOfOrigin; _receiver = new RdsReceiver(name); }