public RecorderControlViewModel(RecordersViewModel parent, Recorder recorder)
        {
            _parent = parent;
            _recorder = recorder;

            ViewModelHelper.BindNotifyChanged(_recorder.RecordDescription, this,
                (sender, e) => RaisePropertyChanged(e.PropertyName));

            ViewModelHelper.BindNotifyChanged(_recorder, this,
                (sender, e) => RaisePropertyChanged(e.PropertyName));

            // IsPlayingの状態が変わったら、PlayCommand/StopCommandの有効無効を切り替える
            Observable.FromEventPattern<PropertyChangedEventArgs>(_recorder, "PropertyChanged")
                .Where(e => e.EventArgs.PropertyName == "IsRecording" || e.EventArgs.PropertyName == "IsPausing")
                .Subscribe(_ =>
                {
                    _PlayCommand.RaiseCanExecuteChanged();
                    _PauseCommand.RaiseCanExecuteChanged();
                    _StopCommand.RaiseCanExecuteChanged();
                });

            Observable.FromEventPattern<PropertyChangedEventArgs>(_recorder, "PropertyChanged")
                .Where(e => e.EventArgs.PropertyName == "IsAlive")
                .Subscribe(_ => _ReinitializeCommand.RaiseCanExecuteChanged());

            Observable.FromEventPattern<ErrorInfoEventArgs>(_recorder, "ErrorRaised")
                .Subscribe(e => Messenger.Raise(new InformationMessage(e.EventArgs.Message, "エラー", "ShowError")));
        }
Beispiel #2
0
        public RecorderControlViewModel(RecordersViewModel parent, Recorder recorder)
        {
            _parent   = parent;
            _recorder = recorder;

            ViewModelHelper.BindNotifyChanged(_recorder.RecordDescription, this,
                                              (sender, e) => RaisePropertyChanged(e.PropertyName));

            ViewModelHelper.BindNotifyChanged(_recorder, this,
                                              (sender, e) => RaisePropertyChanged(e.PropertyName));

            // IsPlayingの状態が変わったら、PlayCommand/StopCommandの有効無効を切り替える
            Observable.FromEventPattern <PropertyChangedEventArgs>(_recorder, "PropertyChanged")
            .Where(e => e.EventArgs.PropertyName == "IsRecording" || e.EventArgs.PropertyName == "IsPausing")
            .Subscribe(_ =>
            {
                _PlayCommand.RaiseCanExecuteChanged();
                _PauseCommand.RaiseCanExecuteChanged();
                _StopCommand.RaiseCanExecuteChanged();
            });


            Observable.FromEventPattern <PropertyChangedEventArgs>(_recorder, "PropertyChanged")
            .Where(e => e.EventArgs.PropertyName == "IsAlive")
            .Subscribe(_ => _ReinitializeCommand.RaiseCanExecuteChanged());


            Observable.FromEventPattern <ErrorInfoEventArgs>(_recorder, "ErrorRaised")
            .Subscribe(e => Messenger.Raise(new InformationMessage(e.EventArgs.Message, "エラー", "ShowError")));
        }
Beispiel #3
0
 private void CheckAllStop()
 {
     if (RecordersViewModel.HasRecordingRecorder() || PlayersViewModel.HasPlayingPlayers())
     {
         Messenger.Raise(new InteractionMessage("AllStop"));
     }
 }
Beispiel #4
0
 private void AllStop(ConfirmationMessage message)
 {
     if (message.Response.HasValue && message.Response.Value)
     {
         RecordersViewModel.StopAllRecorders();
         PlayersViewModel.StopAllPlayers();
     }
 }
        public MainWindowViewModel()
        {
            _manager = NamingServiceManager.Default;

            RecordersViewModel = new RecordersViewModel(_manager);
            PlayersViewModel = new PlayersViewModel(_manager);
            SettingViewModel = new SettingViewModel(_manager);
            AnalysisViewModel = new AnalysisViewModel(_manager);
        }
Beispiel #6
0
        public MainWindowViewModel()
        {
            _manager = NamingServiceManager.Default;

            RecordersViewModel = new RecordersViewModel(_manager);
            PlayersViewModel   = new PlayersViewModel(_manager);
            SettingViewModel   = new SettingViewModel(_manager);
            AnalysisViewModel  = new AnalysisViewModel(_manager);
        }