예제 #1
0
        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);
            }
        }
예제 #2
0
 private void LoadServices()
 {
     services.Clear();
     foreach (Service service in configuration.Load())
     {
         ServicePanel panel = new ServicePanel(this, service);
         DisplayService(panel, false);
     }
 }
예제 #3
0
        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();
        }
예제 #4
0
 private void DisplayService(ServicePanel service, bool expanded)
 {
     service.Display(expanded);
     services.Add(service);
     UpdateSaveButtonState();
 }