Exemple #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);
        }
Exemple #2
0
 public TimetableService(AbemaApiClient abemaApiClient, Configuration configuration, DatabaseService databaseService)
 {
     _abemaApiClient         = abemaApiClient;
     _configuration          = configuration;
     _databaseService        = databaseService;
     _currentSlotInternal    = new ObservableCollection <Slot>();
     _currentFavSlotInternal = new ObservableCollection <Slot>();
     _favorites = configuration.Root.Internal.FavoriteChannels;
 }
Exemple #3
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);
 }
Exemple #4
0
 public AbemaState(AbemaApiClient abemaApiHost, Configuration configuration, DatabaseService databaseService,
                   NetworkHandler networkHandler)
 {
     _abemaApiHost    = abemaApiHost;
     _configuration   = configuration;
     _databaseService = databaseService;
     using (var connector = databaseService.Connect())
         CurrentChannel = connector.Channels.SingleOrDefault(w => w.ChannelId == _configuration.Root.LastViewedChannelStr);
     _disposable = Observable.Timer(TimeSpan.Zero, TimeSpan.FromSeconds(1)).Subscribe(w => SyncEpisode());
     networkHandler.RegisterInstance(this, w => w.Url.StartsWith("https://api.abema.io/v1/slotAudience?"));
 }
Exemple #5
0
        public CommentHost(AbemaApiClient abemaApiHost, AbemaState abemaState, Configuration configuration,
                           StatusService statusService)
        {
            Comments             = new ObservableCollection <Comment>();
            _compositeDisposable = new CompositeDisposable();

            _abemaApiHost  = abemaApiHost;
            _abemaState    = abemaState;
            _configuration = configuration;
            _statusService = statusService;
            _compositeDisposable.Add(_abemaState.ObserveProperty(w => w.CurrentSlot).Subscribe(w => ReloadComments()));
            ReloadComments();
        }