Ejemplo n.º 1
0
 public MonitorWorkItem Add(MonitorEntry entry, params Target[] targets)
 {
     Target[] targetArray;
     if (entry == null)
     {
         throw new ArgumentNullException("entry");
     }
     if (!this._ignore.Any <ISpecification <MonitorEntry> >((ISpecification <MonitorEntry> x) => x.IsSatisfiedBy(entry)))
     {
         targets = targets ?? new Target[0];
         if (this._redirects.TryHandle(entry, out targetArray))
         {
             Target[] targetArray1 = targets;
             Target[] targetArray2 = targetArray ?? new Target[0];
             targets = ((IEnumerable <Target>)targetArray1).Concat <Target>((IEnumerable <Target>)targetArray2).ToArray <Target>();
         }
         if (targets.Length == 0)
         {
             targets = new Target[] { Target.Service };
         }
         foreach (Target target in targets.Distinct <Target>())
         {
             this._entries.Add(Tuple.Create <Target, MonitorEntry>(target ?? Target.Service, entry));
         }
     }
     return(this);
 }
Ejemplo n.º 2
0
        public MonitorWorkItem Add(MonitorEntry entry, params Target[] targets)
        {
            if (entry == null)
            {
                throw new ArgumentNullException(nameof(entry));
            }

            if (!_ignore.Any(x => x.IsSatisfiedBy(entry)))
            {
                targets = targets ?? new Target[0];

                if (_redirects.TryHandle(entry, out Target[] redirects))