Beispiel #1
0
 private bool IsNotified(MonitorItem item, string Key, string runtimeValue, string message, out NotifiedMonitorItem notified)
 {
     notified = null;
     var key = item.ToString() + ", " + Key + ", " + runtimeValue;
     if (!_notifiedAlerts.ContainsKey(key))
     {
         notified = new NotifiedMonitorItem { Server = item.Server, CurrentValue = message, CreatedDate = DateTime.Now };
         _notifiedAlerts.Add(key, notified);
         if (Settings.Instance.LogHistory)
             Settings.Instance.NotifiedAlerts.Add(notified);
         return false;
     }
     else
         return true;
 }
Beispiel #2
0
 public AlertEventArgs(MonitorItem item, NotifiedMonitorItem notification, string message)
     : base(message, false)
 {
     this.Item         = item;
     this.Notification = notification;
 }
Beispiel #3
0
 public AlertEventArgs(MonitorItem item, NotifiedMonitorItem notification, string message)
     : base(message, false)
 {
     this.Item = item;
     this.Notification = notification;
 }
Beispiel #4
0
        private bool IsNotified(MonitorItem item, string Key, string runtimeValue, string message, out NotifiedMonitorItem notified)
        {
            notified = null;
            var key = item.ToString() + ", " + Key + ", " + runtimeValue;

            if (!_notifiedAlerts.ContainsKey(key))
            {
                notified = new NotifiedMonitorItem {
                    Server = item.Server, CurrentValue = message, CreatedDate = DateTime.Now
                };
                _notifiedAlerts.Add(key, notified);
                if (Settings.Instance.LogHistory)
                {
                    Settings.Instance.NotifiedAlerts.Add(notified);
                }
                return(false);
            }
            else
            {
                return(true);
            }
        }