示例#1
0
 public FireEvent(FireEventId id, DateTime time, string targetId, string targetDescription, EventTypes eventType)
 {
     this.Id                = id;
     this.TimeStamp         = time;
     this.TargetId          = targetId;
     this.TargetDescription = targetDescription;
     this.EventType         = eventType;
 }
示例#2
0
 public static bool Equals(this FireEventId feId, FireEventId other)
 {
     if (feId.SourceId == other.SourceId && feId.EventId == other.EventId)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#3
0
        /// <summary>
        /// Checks if an id is already used by another FireEvent.
        /// </summary>
        /// <param name="id">The id you want to check.</param>
        /// <returns>Returns true if id is not used by other FireEvent.</returns>
        public static bool CheckId(FireEventId id)
        {
            IEnumerable <FireEvent> all = GetAll();

            if (id.SourceId == 0 || id.EventId == 0)
            {
                return(false);
            }

            foreach (FireEvent fe in all)
            {
                if (fe.Id.SourceId == id.SourceId && fe.Id.EventId == id.EventId)
                {
                    return(false);
                }
            }
            return(true);
        }
示例#4
0
 public static int GetHashCode(this FireEventId feId)
 {
     return(feId.SourceId.GetHashCode() ^ feId.EventId.GetHashCode());
 }