private void _checkPendingStateOperations_OnTimeSlice() { lock (_systemClock) { if (_currentStateFile != null) { switch (_pendingStateOperation) { case PendingStateOperations.Load: ReadDeviceState(_currentStateFile); if (OnLoadState != null) { OnLoadState(_currentStateFile); } _currentStateFile.Close(); _currentStateFile = null; break; case PendingStateOperations.Save: WriteDeviceState(_currentStateFile); if (OnSaveState != null) { OnSaveState(_currentStateFile); } _currentStateFile.Close(); _currentStateFile = null; break; } } } }
private void _checkPendingStateOperations_OnTimeSlice() { lock (_systemClock) { if (_currentStateFile != null) { switch (_pendingStateOperation) { case PendingStateOperations.Load: ReadDeviceState(_currentStateFile); if (OnLoadState != null) OnLoadState(_currentStateFile); _currentStateFile.Close(); _currentStateFile = null; break; case PendingStateOperations.Save: WriteDeviceState(_currentStateFile); if (OnSaveState != null) OnSaveState(_currentStateFile); _currentStateFile.Close(); _currentStateFile = null; break; } } } }