public void Load(BinaryReader reader)
        {
            // Get services
            ServiceInfo.GetServices(ConfigurationManager.Services);

            // Get number of service infos
            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                // Get service info
                ServiceInfo service = ServiceInfo.Parse(reader);

                // Find service with matching name
                ServiceInfo match = ConfigurationManager.Services.FirstOrDefault(x => x.Name == service.Name);

                // If match was found
                if (match != null)
                {
                    match.Status      = service.Status;
                    match.StartupType = service.StartupType;
                    match.IsScored    = service.IsScored;
                }
                else
                {
                    // Add service to list
                    ConfigurationManager.Services.Add(service);
                }
            }
        }
Esempio n. 2
0
 public void PopulateServices()
 {
     // Get services
     ServiceInfo.GetServices(ConfigurationManager.Services);
 }