示例#1
0
        /// <summary>
        /// Check if the given enumeration of EVSEs and their current status
        /// contains the given pair of EVSE identification and status.
        /// </summary>
        /// <param name="AdminStatus">An enumeration of EVSEs and their current status.</param>
        /// <param name="Id">An EVSE identification.</param>
        /// <param name="Status">An EVSE status.</param>
        public static Boolean Contains(this IEnumerable <EVSEAdminStatus> AdminStatus,
                                       EVSE_Id Id,
                                       EVSEAdminStatusType Status)
        {
            foreach (var adminstatus in AdminStatus)
            {
                if (adminstatus.Id == Id &&
                    adminstatus.Status == Status)
                {
                    return(true);
                }
            }

            return(false);
        }
示例#2
0
        /// <summary>
        /// Create a new EVSE status.
        /// </summary>
        /// <param name="Id">The unique identification of an EVSE.</param>
        /// <param name="Status">The current status of an EVSE.</param>
        /// <param name="Timestamp">The timestamp of the current status of the EVSE.</param>
        public EVSEAdminStatus(EVSE_Id Id,
                               EVSEAdminStatusType Status,
                               DateTime Timestamp)

        {
            #region Initial checks

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

            #endregion

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