Catrobat.IDE.Core.ViewModels.Editor.Sounds.SoundRecorderViewModel.ResetViewModel C# (CSharp) Méthode

ResetViewModel() private méthode

private ResetViewModel ( ) : void
Résultat void
        private void ResetViewModel()
        {
            IsPlaying = false;
            IsRecording = false;
            RecordingExists = false;
            RecordingTime = 0;
            PlayingTime = 0;

            if (_recordTimeUpdateTask != null)
            {
                if (ServiceLocator.SoundRecorderService.State == SoundRecorderState.Recording)
                    ServiceLocator.SoundRecorderService.StopRecording();

                if (ServiceLocator.SoundRecorderService.State == SoundRecorderState.Playing)
                    ServiceLocator.SoundRecorderService.StopPlayingRecordedSound();

                //_recordTimeUpdateTaskCancellationToken.Cancel();
                //_recordTimeUpdateTask.Abort();
            }
            _recordTimeUpdateTask = null;
            _recorderStartTime = new DateTime();
            _recorderTimeGoneBy = new TimeSpan();

            //if (_playerTimeUpdateTask != null)
            //{
            //    if (ServiceLocator.SoundRecorderService.State == SoundRecorderState.Recording)
            //    ServiceLocator.SoundRecorderService.StopRecording();

            //    if (ServiceLocator.SoundRecorderService.State == SoundRecorderState.Playing)
            //        ServiceLocator.SoundRecorderService.StopPlayingRecordedSound();

            //    //_playerTimeUpdateTaskCancellationToken.Cancel();
            //    //_playerTimeUpdateTask.Abort();
            //}
            _playerTimeUpdateTask = null;
            _playerStartTime = new DateTime();
            _playerTimeGoneBy = new TimeSpan();
        }
    }