Example #1
0
        /// <summary>
        /// Polls the <see cref="Alarm"/> component for alarms that have been triggered
        /// since the provided <paramref name="start"/> date/time.  If <paramref name="start"/>
        /// is null, all triggered alarms will be returned.
        /// </summary>
        /// <param name="start">The earliest date/time to poll trigerred alarms for.</param>
        /// <param name="end"></param>
        /// <returns>A list of <see cref="AlarmOccurrence"/> objects, each containing a triggered alarm.</returns>
        virtual public IList <AlarmOccurrence> Poll(IDateTime start, IDateTime end)
        {
            var results = new List <AlarmOccurrence>();

            // Evaluate the alarms to determine the recurrences
            RecurringComponent rc = Parent as RecurringComponent;

            if (rc != null)
            {
                results.AddRange(GetOccurrences(rc, start, end));
                results.Sort();
            }
            return(results);
        }
 public override bool Equals(object obj)
 {
     if (obj is RecurringComponent &&
         obj != this)
     {
         RecurringComponent r = (RecurringComponent)obj;
         if (UID != null)
         {
             return(UID.Equals(r.UID));
         }
         else
         {
             return(UID == r.UID);
         }
     }
     return(base.Equals(obj));
 }