Beispiel #1
0
        public static IChatPollingService GetChatPollingService()
        {
            if (_chatPollingService == null)
            {
                _chatPollingService = new ChatPollingService(GetChatService());
            }

            return(_chatPollingService);
        }
Beispiel #2
0
 public ChatController(IAngebotService angebotService, IChatPollingService chatPollingService, IChatBufferService chatBufferService, IProfilService profilService, ILoginService loginService)
 {
     _angebotService     = angebotService;
     _chatPollingService = chatPollingService;
     _chatPollingService.NachrichtErhalten += _chatPollingService_NachrichtErhalten;
     _chatBufferService = chatBufferService;
     _chatBufferService.NewChatCreated += _chatBufferService_NewChatCreated;
     _profilService = profilService;
     _loginService  = loginService;
 }
Beispiel #3
0
        public ChatViewModel(ChatInfo chatInfo, IChatPollingService chatPollingService, IChatService chatService, ILoginService loginService, IChatBufferService chatBufferService, IProfilService profilService, Angebot angebot)
        {
            _chatPollingService = chatPollingService;
            _chatPollingService.NachrichtErhalten += _chatPollingService_NachrichtErhalten;
            _chatService       = chatService;
            _loginService      = loginService;
            _chatBufferService = chatBufferService;
            _profilService     = profilService;

            Nachrichten = new ObservableCollection <ChatNachrichtViewModel>(chatInfo.Nachrichten.Select(c => new ChatNachrichtViewModel(c)
            {
                IchBinEmpfaenger = _loginService.AnbieterId == c.EmpfaengerAnbieterID, IchWarSender = _loginService.AnbieterId == c.SenderAnbieterID
            }));

            AngebotViewModel = new AngebotViewModel(angebot);
            _chatPollingService.StartPolling(angebot);

            _chatInfo = chatInfo;
            InitGegenseiteAsync();
        }