public void AddService(ChangedService service) { if (service == null) { return; } if (services == null) { services = new List <ChangedService>(); } service._isFireAcceptedChangedEvent = false; service.ModelChanged += new EventHandler(service_ModelChanged); services.Add(service); }
public void RemoveService(ChangedService service) { if (service == null) { return; } if (services == null) { return; } if (!services.Contains(service)) { return; } service.ModelChanged -= service_ModelChanged; services.Remove(service); if (services.Count == 0) { services = null; } }