public virtual void Receive(AuthenticationTokenReceiveContext context)
        {
            if (OnReceiveAsync != null && OnReceive == null)
            {
                throw new InvalidOperationException(Resources.Exception_AuthenticationTokenDoesNotProvideSyncMethods);
            }

            if (OnReceive != null)
            {
                OnReceive.Invoke(context);
            }
        }
 public virtual async Task ReceiveAsync(AuthenticationTokenReceiveContext context)
 {
     if (OnReceiveAsync != null && OnReceive == null)
     {
         throw new InvalidOperationException(Resources.Exception_AuthenticationTokenDoesNotProvideSyncMethods);
     }
     if (OnReceiveAsync != null)
     {
         await OnReceiveAsync.Invoke(context);
     }
     else
     {
         Receive(context);
     }
 }