System.Windows.Forms.XplatUIX11.NextTimeout C# (CSharp) Method

NextTimeout() private method

private NextTimeout ( ArrayList timers, DateTime now ) : int
timers ArrayList
now DateTime
return int
		private int NextTimeout (ArrayList timers, DateTime now) {
			int timeout = 0; 

			foreach (Timer timer in timers) {
				int next = (int) (timer.Expires - now).TotalMilliseconds;
				if (next < 0) {
					return 0; // Have a timer that has already expired
				}

				if (next < timeout) {
					timeout = next;
				}
			}
			if (timeout < Timer.Minimum) {
				timeout = Timer.Minimum;
			}

			if (timeout > 1000)
				timeout = 1000;
			return timeout;
		}
XplatUIX11