private void LoadUpToDateServices() { serviceNameField.Items.Clear(); upToDateServices.Clear(); upToDateServices.AddRange(upToDateConfiguration.Load()); bool updated = false; foreach (Service service in upToDateServices) { ServicePanel configurationService = services.Find(s => s.Exists(service.Name)); if (configurationService != null) { configurationService.UpdateFrom(service); updated = true; } else { serviceNameField.Items.Add(service); } } if (updated) { configuration.Save(configurationFilePath); } }
private void LoadServices() { services.Clear(); foreach (Service service in configuration.Load()) { ServicePanel panel = new ServicePanel(this, service); DisplayService(panel, false); } }
internal void Removed(ServicePanel service) { services.Remove(service); Service removedService = upToDateServices.Find(s => service.Exists(s.Name)); if (removedService != null) { serviceNameField.Items.Add(removedService); } UpdateSaveButtonState(); }
private void DisplayService(ServicePanel service, bool expanded) { service.Display(expanded); services.Add(service); UpdateSaveButtonState(); }