Exemplo n.º 1
0
        public AbemaCommentViewModel(AbemaApiClient abemaApiHost, AbemaState abemaState, Configuration configuration,
                                     StatusService statusService)
        {
            var commentHost = new CommentHost(abemaApiHost, abemaState, configuration, statusService).AddTo(this);

            Comments = commentHost.Comments.ToReadOnlyReactiveCollection(w => new CommentViewModel(w)).AddTo(this);
        }
Exemplo n.º 2
0
 public AbemaCommentInputViewModel(AbemaApiClient abemaApiHost, AbemaState abemaState,
                                   Configuration configuration)
 {
     _abemaApiHost  = abemaApiHost;
     _abemaState    = abemaState;
     _configuration = configuration;
     Comment        = new ReactiveProperty <string>("").AddTo(this);
     Comment.Subscribe(w => SendCommentCommand.RaiseCanExecuteChanged()).AddTo(this);
 }
Exemplo n.º 3
0
        public ShellViewModel(AbemaState abemaState, Configuration config, Connector connector,
                              Reservation reservation, NetworkHandler networkHandler)
        {
            _configuration  = config;
            SettingsRequest = new InteractionRequest <INotification>();

            Title = abemaState.ObserveProperty(w => w.CurrentSlot)
                    .Select(w => $"{w?.Title ?? "AbemaTV"} - Norma")
                    .ToReadOnlyReactiveProperty($"{abemaState.CurrentSlot?.Title ?? "AbemaTV"} - Norma")
                    .AddTo(this);
            IsTopMost = ReactiveProperty.FromObject(config.Root.Internal, w => w.IsTopMost).AddTo(this);
        }
Exemplo n.º 4
0
        public AbemaHostViewModel(AbemaState abemaState, Connector connector, DatabaseService databaseService,
                                  NetworkHandler networkHandler, ReservationService reservationService)
        {
            _abemaState         = abemaState;
            _databaseService    = databaseService;
            _reservationService = reservationService;

            _abemaState.ObserveProperty(w => w.CurrentChannel)
            .Where(w => w != null)
            .SubscribeOnUIDispatcher()
            .Subscribe(w => Address = $"https://abema.tv/now-on-air/{w.ChannelId}");
            connector.RegisterInsance <ChangeChannelOp>(this);
            networkHandler.RegisterInstance(this, e => e.Url.EndsWith("/slotReservations"));
            Address = $"https://abema.tv/now-on-air/abema-news";
        }
Exemplo n.º 5
0
 public ChannelViewModel(AbemaState abemaState, AbemaChannel channel, Configuration configuration)
 {
     _abemaState    = abemaState;
     _model         = channel;
     _configuration = configuration;
     Title          = _model.ObserveProperty(w => w.Title)
                      .ToReadOnlyReactiveProperty()
                      .AddTo(this);
     StartTime = _model.ObserveProperty(w => w.StartAt)
                 .Select(w => w.ToString("HH:mm"))
                 .ToReadOnlyReactiveProperty()
                 .AddTo(this);
     EndTime = _model.ObserveProperty(w => w.EndAt)
               .Select(w => w.ToString("HH:mm"))
               .ToReadOnlyReactiveProperty()
               .AddTo(this);
     ThumbnailUrl = _model.ObserveProperty(x => x.ThumbnailUrl).ToReadOnlyReactiveProperty().AddTo(this);
 }
Exemplo n.º 6
0
        public AbemaTVGuideViewModel(AbemaState abemaState, Configuration configuration, TimetableService timetableService)
        {
            _abemaState    = abemaState;
            _configuration = configuration;

            if (!_configuration.Root.Operation.IsShowFavoriteOnly)
            {
                Channnels = timetableService.CurrentSlots
                            .ToReadOnlyReactiveCollection(w => Func(w.Channel))
                            .AddTo(this);
            }
            else
            {
                Channnels = timetableService.CurrentFavSlots
                            .ToReadOnlyReactiveCollection(w => Func(w.Channel))
                            .AddTo(this);
            }
        }
        public AbemaProgramInfoViewModel(AbemaState abemaState, StatusService statusService)
        {
            var programHost = new ProgramHost(abemaState, statusService).AddTo(this);

            Title       = programHost.ObserveProperty(w => w.Title).ToReadOnlyReactiveProperty().AddTo(this);
            Description = programHost.ObserveProperty(w => w.Description).ToReadOnlyReactiveProperty().AddTo(this);
            HasInfo     = programHost.ObserveProperty(w => w.Title)
                          .Select(w => !string.IsNullOrWhiteSpace(w))
                          .ToReadOnlyReactiveProperty().AddTo(this);
            Thumbnail1 = programHost.ObserveProperty(w => w.Thumbnail1).ToReadOnlyReactiveProperty().AddTo(this);
            Thumbnail2 = programHost.ObserveProperty(w => w.Thumbnail2).ToReadOnlyReactiveProperty().AddTo(this);
            AtChannel  = abemaState.ObserveProperty(w => w.CurrentChannel)
                         .Where(w => w != null)
                         .Select(w => $"at {w.Name.Replace("チャンネル", "")}")
                         .ToReadOnlyReactiveProperty().AddTo(this);
            Range = abemaState.ObserveProperty(w => w.CurrentSlot)
                    .Where(w => w != null)
                    .Select(w => $"{w.StartAt.ToString("t")} ~ {w.EndAt.ToString("t")}")
                    .ToReadOnlyReactiveProperty().AddTo(this);
            Casts = programHost.Casts.ToReadOnlyReactiveCollection().AddTo(this);
            Crews = programHost.Crews.ToReadOnlyReactiveCollection().AddTo(this);
        }