protected void TryEvent_NoLock(InputEvent evt) { bool showBusyScreen = false; lock (_syncObj) { if (IsTerminated) { return; } if (_callingClientStart.HasValue && _callingClientStart.Value < DateTime.Now - BUSY_TIMEOUT) { // Client call lasts longer than our BUSY_TIMEOUT ClearInputBuffer(); // Discard all later input if (!_busyScreenVisible) { showBusyScreen = true; } } } if (showBusyScreen) { ISuperLayerManager superLayerManager = ServiceRegistration.Get <ISuperLayerManager>(); superLayerManager.ShowBusyScreen(); lock (_syncObj) _busyScreenVisible = true; return; // Finished, no further processing } EnqueueEvent(evt); }
private void BusyTimeoutTimerCallback(object state) { lock (_syncObj) { if (IsTerminated || !_callingClientStart.HasValue) { return; } // Client call lasts longer than our BUSY_TIMEOUT ClearInputBuffer(); // Discard all later input if (_busyScreenVisible) { return; } } ISuperLayerManager superLayerManager = ServiceRegistration.Get <ISuperLayerManager>(); superLayerManager.ShowBusyScreen(); lock (_syncObj) _busyScreenVisible = true; }