public bool DeleteBoat(Boat a_boat) { bool success = this.Boats.Remove(a_boat); if (success) { //un-subscribe to boat events a_boat.RemoveSubscriber(this); this.NotifySubscribersChangeMade(); } return success; }
//Methods public bool AddBoat(Boat a_boat) { if (a_boat.HasCorrectDetails) { //subscribe to boat events a_boat.AddSubscriber(this); //add it to array m_boats.Add(a_boat); //notify subscribers this.NotifySubscribersChangeMade(); return true; } return false; }