Exemplo n.º 1
0
        public bool CanHandle(ITimeRetrievalService timeRetrievalService)
        {
            var currentTime = timeRetrievalService.Now();
            var start       = new TimeSpan(06, 0, 0);
            var end         = new TimeSpan(12, 0, 0);

            return(currentTime >= start && currentTime <= end);
        }
Exemplo n.º 2
0
        public bool CanHandle(ITimeRetrievalService timeRetrievalService)
        {
            var currentTime = timeRetrievalService.Now();
            var start       = new TimeSpan(22, 0, 0);
            var end         = new TimeSpan(06, 0, 0);

            if (start < end)
            {
                return(start <= currentTime && currentTime <= end);
            }
            return(!(end < currentTime && currentTime < start));
        }