Esempio n. 1
0
        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;
                    }
                }
            }
        }
Esempio n. 2
0
        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;
                    }
                }
            }
        }