Example #1
0
 public LongPollService()
 {
     _sessionInfoRepo = DIService.GetSingleton<SessionInfoRepo>();
     _friendsService = new FriendsService();
     _dialogMessagesRepo = DIService.GetSingleton<DialogMessagesRepo>();
     _dialogMessagesService = new DialogMessagesService();
     _mp3Player = new Mp3Player(Sounds.IncomingMessage);
 }
        public MessageInput()
        {
            InitializeComponent();

            if (this.NotInDesignMode())
            {
                _dialogMessagesService = new DialogMessagesService();
            }
        }
        private void MarkAsReaded(int friendId)
        {
            if (Focused && _friendId == friendId)
            {
                var dialogMessageService = new DialogMessagesService();
                Task.Run(() => dialogMessageService.MarkAsReaded(friendId));
            }

            _timer.Dispose();
        }
Example #4
0
 async private void FriendsControl_OnFriendItemSelected(object sender, FriendSelectedEventArgs e)
 {
     var friendId = e.Friend.VkId;
     MessagesList.SetFriendId(friendId);
     MessageInput.SetFriendId(friendId);
     var dialogMessagesService = new DialogMessagesService();
     MessagesList.Refresh();
     await Task.Run(() => ActionExecutor.RunScenario(dialogMessagesService.LoadFromVkByFriendId, friendId));
     await Task.Run(() => FriendsControl.UpdateMessagesCount(friendId));
     await Task.Run(() => dialogMessagesService.SaveToDB());
 }