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); }
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; }
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); }
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?")); }
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(); }