public static ServerNotification GetNotification(this ServerMonitor serverMonitor, List <ServerStrategy> serverStrategies)
        {
            if (serverMonitor == null)
            {
                throw new ArgumentNullException(nameof(serverMonitor));
            }

            var clone = new ServerMonitor
            {
                Name = serverMonitor.Name,
                Uri  = serverMonitor.Uri,
                MaxDegreeOfParallelism = serverMonitor.MaxDegreeOfParallelism,
                StartedBy = serverMonitor.StartedBy,
                Started   = serverMonitor.Started,
                StoppedBy = serverMonitor.StoppedBy,
                Stopped   = serverMonitor.Stopped
            };

            clone.Strategies.AddRange(serverStrategies);

            return(new ServerNotification
            {
                Machine = Environment.MachineName,
                Message = clone.ToString()
            });
        }
Example #2
0
        public static ServerNotification GetNotification(this ServerMonitor serverMonitor, List <ServerStrategy> serverStrategies)
        {
            var clone = new ServerMonitor
            {
                Name = serverMonitor.Name,
                Url  = serverMonitor.Url,
                MaxDegreeOfParallelism = serverMonitor.MaxDegreeOfParallelism,
                StartedBy  = serverMonitor.StartedBy,
                Started    = serverMonitor.Started,
                StoppedBy  = serverMonitor.StoppedBy,
                Stopped    = serverMonitor.Stopped,
                Strategies = serverStrategies
            };

            return(new ServerNotification
            {
                Machine = Environment.MachineName,
                Message = clone.ToString()
            });
        }