Exemple #1
0
 public async Task Handle(LoggedOutNotification notification, CancellationToken cancellationToken)
 {
     var          context = fLoggingContextService.GetRequestContext();
     var          @event  = new UserLoggedOutEvent(notification.UserId.ToString(), context);
     const string method  = nameof(IRemoteClient.UserLoggedOutEventAsync);
     await fClientHubService.SendEventAsync(@event, method, context, cancellationToken);
 }
 /// <summary>
 /// Fire user logged out event.
 /// </summary>
 /// <param name="userContext">Information about the user that has logged out.</param>
 private void FireUserLoggedOutEvent(IUserContext userContext)
 {
     if (UserLoggedOutEvent.IsNotNull())
     {
         UserLoggedOutEvent(userContext);
     }
 }
        public Task Handle(LoggedOutNotification notification, CancellationToken cancellationToken)
        {
            var          context = fLoggingContextService.GetRequestContext();
            var          @event  = new UserLoggedOutEvent(fIdentityService.Current.UserId.ToString(), context);
            const string method  = nameof(IRemoteClient.UserLoggedOutEventAsync);

            return(fBrodacastHubService.SendEventAsync(@event, method, context, cancellationToken));
        }
        /// <summary>
        /// Logout user.
        /// </summary>
        public static void Logout()
        {
            _user = null;
            WebServiceClient.Logout();

            // Fire user logged out event.
            if (UserLoggedOutEvent.IsNotNull())
            {
                UserLoggedOutEvent();
            }
        }
 private async Task UserLoggedOutEventAsync(UserLoggedOutEvent @event)
 {
     await HandleEventAsync(@event);
 }