Beispiel #1
0
        /// <summary>
        /// Checks if time window includes given time.
        /// </summary>
        /// <param name="timeWindow">Time window.</param>
        /// <param name="arriveDateTime">Arrive date time.</param>
        /// <param name="plannedDateTime">Planned date time.</param>
        /// <returns>True - if arrive time is inside time window, false - otherwise.</returns>
        private static bool _DoesTimeWindowIncludeTime(TimeWindow timeWindow, DateTime?arriveDateTime, DateTime?plannedDateTime)
        {
            Debug.Assert(timeWindow != null);

            bool result = false;

            // Check if arrive and planned date time have values.
            if (arriveDateTime.HasValue && plannedDateTime.HasValue)
            {
                // Check if arrive time is inside the time window.
                result = timeWindow.DoesIncludeTime(arriveDateTime.Value, plannedDateTime.Value);
            }
            else
            {
                result = false;
            }

            return(result);
        }