Exemplo n.º 1
0
        public PlayerControlViewModel(PlayersViewModel parent, Player player)
        {
            _parent = parent;
            _player = player;

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

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


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


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

            Observable.FromEventPattern <ErrorInfoEventArgs>(_player, "ErrorRaised")
            .Subscribe(e => Messenger.Raise(new InformationMessage(e.EventArgs.Message, "エラー", "ShowError")));
        }
Exemplo n.º 2
0
 private void CheckAllStop()
 {
     if (RecordersViewModel.HasRecordingRecorder() || PlayersViewModel.HasPlayingPlayers())
     {
         Messenger.Raise(new InteractionMessage("AllStop"));
     }
 }
Exemplo n.º 3
0
        public PlayerControlViewModel(PlayersViewModel parent, Player player)
        {
            _parent = parent;
            _player = player;

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

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

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

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

            Observable.FromEventPattern<ErrorInfoEventArgs>(_player, "ErrorRaised")
                .Subscribe(e => Messenger.Raise(new InformationMessage(e.EventArgs.Message, "エラー", "ShowError")));
        }
Exemplo n.º 4
0
 private void AllStop(ConfirmationMessage message)
 {
     if (message.Response.HasValue && message.Response.Value)
     {
         RecordersViewModel.StopAllRecorders();
         PlayersViewModel.StopAllPlayers();
     }
 }
Exemplo n.º 5
0
        public MainWindowViewModel()
        {
            _manager = NamingServiceManager.Default;

            RecordersViewModel = new RecordersViewModel(_manager);
            PlayersViewModel = new PlayersViewModel(_manager);
            SettingViewModel = new SettingViewModel(_manager);
            AnalysisViewModel = new AnalysisViewModel(_manager);
        }
Exemplo n.º 6
0
        public MainWindowViewModel()
        {
            _manager = NamingServiceManager.Default;

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