Exemplo n.º 1
0
 /// <summary>
 /// Остановить сервис сообщений и сохранить состояние.
 /// </summary>
 public void StopAndSave()
 {
     longPollService.MessagesReceived -= LongPollService_MessagesReceived;
     messagesCacheService              = null;
     messagesUsersService              = null;
     dialogsService  = null;
     longPollService = null;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Запустить сервис сообщений и восстановить состояние.
        /// </summary>
        public void StartAndRestore()
        {
            messagesCacheService = ServiceLocator.Current.GetInstance <IMessagesCacheService>();
            messagesUsersService = ServiceLocator.Current.GetInstance <IMessagesUsersService>();
            dialogsService       = ServiceLocator.Current.GetInstance <IDialogsCacheService>();
            longPollService      = ServiceLocator.Current.GetInstance <VKLongPollService>();

            longPollService.MessagesReceived += LongPollService_MessagesReceived;
        }