private void UpdateMonitor(IStatusMonitor existingMonitor, MonitorConfiguration monitorConfiguration)
        {
            var updatedMonitor = StatusMonitorFactory.Create(monitorConfiguration, _networkUtil);

            updatedMonitor.CopyStatusFrom(existingMonitor);
            _statusMonitorConfiguration.Monitors.Remove(existingMonitor);
            _statusMonitorConfiguration.Monitors.Add(updatedMonitor);
        }
        public static async Task <StatusMonitorConfiguration> Create(StatusMonitorClient statusMonitorApi, INetworkUtil networkUtil)
        {
            try
            {
                var monitorConfigs = await statusMonitorApi.GetConfigurationsAsync();

                return(new StatusMonitorConfiguration
                {
                    Monitors = monitorConfigs
                               .Where(mc => mc.Active)
                               .Select(mc => StatusMonitorFactory.Create(mc, networkUtil))
                               .Where(monitor => monitor != null)
                               .ToList()
                });
            }
            catch
            {
                return(new StatusMonitorConfiguration());
            }
        }
 private void AddMonitor(MonitorConfiguration monitorConfiguration)
 {
     _statusMonitorConfiguration.Monitors.Add(StatusMonitorFactory.Create(monitorConfiguration, _networkUtil));
 }