/// <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="AdminStatus">An enumeration of charging stations and their current status.</param>
        /// <param name="Id">A charging station identification.</param>
        /// <param name="Status">A charging station status.</param>
        public static Boolean Contains(this IEnumerable <ChargingStationAdminStatus> AdminStatus,
                                       ChargingStation_Id Id,
                                       ChargingStationAdminStatusType Status)
        {
            foreach (var adminstatus in AdminStatus)
            {
                if (adminstatus.Id == Id &&
                    adminstatus.Status == Status)
                {
                    return(true);
                }
            }

            return(false);
        }
Example #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 ChargingStationAdminStatus(ChargingStation_Id Id,
                                          ChargingStationAdminStatusType 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;
        }