public NicoLiveVideo( string liveId, MediaPlayer mediaPlayer, NiconicoSession niconicoSession, NicoLiveProvider nicoLiveProvider, LoginUserLiveReservationProvider loginUserLiveReservationProvider, PlayerSettings playerSettings, IScheduler scheduler, string communityId = null ) { LiveId = liveId; _CommunityId = communityId; MediaPlayer = mediaPlayer; NiconicoSession = niconicoSession; NicoLiveProvider = nicoLiveProvider; LoginUserLiveReservationProvider = loginUserLiveReservationProvider; PlayerSettings = playerSettings; _UIScheduler = scheduler; _LiveComments = new ObservableCollection <LiveChatData>(); LiveComments = new ReadOnlyObservableCollection <LiveChatData>(_LiveComments); LiveComments.ObserveAddChanged() .Where(x => x.IsOperater && x.HasOperatorCommand) .SubscribeOn(_UIScheduler) .Subscribe(chat => { OperationCommandRecieved?.Invoke(this, new OperationCommandRecievedEventArgs() { Chat = chat }); }); }
public void ReadOnlyCollection_ObserveAddChangedTest() { var l = new List <string>(); var c = new ObservableCollection <string>(); var r = new ReadOnlyObservableCollection <string>(c); r.ObserveAddChanged() .Subscribe(x => l.Add(x)); l.Count.Is(0); c.Add("a"); l.Count.Is(1); c.Add("b"); l.Count.Is(2); l.Is("a", "b"); }
public NicoLiveVideo(string liveId, MediaPlayer mediaPlayer, HohoemaApp hohoemaApp, string communityId = null) { LiveId = liveId; _CommunityId = communityId; MediaPlayer = mediaPlayer; HohoemaApp = hohoemaApp; _LiveComments = new ObservableCollection <LiveChatData>(); LiveComments = new ReadOnlyObservableCollection <LiveChatData>(_LiveComments); LiveComments.ObserveAddChanged() .Where(x => x.IsOperater && x.HasOperatorCommand) .SubscribeOnUIDispatcher() .Subscribe(chat => { OperationCommandRecieved?.Invoke(this, new OperationCommandRecievedEventArgs() { Chat = chat }); }); }