/// <summary>
        /// Check if the given enumeration of charging stations and their current status
        /// contains the given pair of charging station identification and status.
        /// </summary>
        /// <param name="ChargingStationStatus">An enumeration of charging stations and their current status.</param>
        /// <param name="Id">An charging station identification.</param>
        /// <param name="Status">An charging station status.</param>
        public static Boolean Contains(this IEnumerable <ChargingStationStatus> ChargingStationStatus,
                                       ChargingStation_Id Id,
                                       ChargingStationStatusType Status)
        {
            foreach (var status in ChargingStationStatus)
            {
                if (status.Id == Id &&
                    status.Status == Status)
                {
                    return(true);
                }
            }

            return(false);
        }
Beispiel #2
0
        /// <summary>
        /// Create a new charging station status.
        /// </summary>
        /// <param name="Id">The unique identification of a charging station.</param>
        /// <param name="Status">The current status of a charging station.</param>
        /// <param name="Timestamp">The timestamp of the current status of the charging station.</param>
        public ChargingStationStatus(ChargingStation_Id Id,
                                     ChargingStationStatusType Status,
                                     DateTime Timestamp)

        {
            #region Initial checks

            if (Id == null)
            {
                throw new ArgumentNullException(nameof(Id), "The given unique identification of a charging station must not be null!");
            }

            #endregion

            this._Id        = Id;
            this._Status    = Status;
            this._Timestamp = Timestamp;
        }