public T OkNok(TimeSpan currentTime) { if (NT == null) { return(Ok); } if (currentTime > Ti && currentTime <= NT.Ti) { return(Ok); } return(NT.OkNok(currentTime)); }
static void Main(string[] args) { TimeSpan t1 = new TimeSpan(8, 48, 0); TimeSpan t2 = new TimeSpan(9, 56, 0); TimeSpan t3 = new TimeSpan(10, 5, 0); TimeSpan t4 = new TimeSpan(13, 30, 0); TO <bool> TO = new TO <bool>(t1, true) { new TO <bool>(t2, false) { new TO <bool> (t3, true) { new TO <bool>(t4, false) } } }; Console.WriteLine("The time now is considered " + TO.OkNok(DateTime.Now)); Console.ReadLine(); }