public static DateTimeEventArgs GetDateTime(int timeout) { _getDateTimeSync.Reset(); _getDateTimeResult = null; DateTimeChanged += GetDateTimeCallback; RequestDateTime(); #if NETMF _getDateTimeSync.WaitOne(timeout, true); #else _getDateTimeSync.WaitOne(timeout); #endif DateTimeChanged -= GetDateTimeCallback; return(_getDateTimeResult); }
private static void GetDateTimeCallback(DateTimeEventArgs e) { _getDateTimeResult = e; _getDateTimeSync.Set(); }
public static DateTimeEventArgs GetDateTime(int timeout) { _getDateTimeSync.Reset(); _getDateTimeResult = null; DateTimeChanged += GetDateTimeCallback; RequestDateTime(); #if NETMF _getDateTimeSync.WaitOne(timeout, true); #else _getDateTimeSync.WaitOne(timeout); #endif DateTimeChanged -= GetDateTimeCallback; return _getDateTimeResult; }