Ejemplo 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;
                    }
                }
            }
        }
Ejemplo 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;
                    }
                }
            }
        }