예제 #1
0
        private async void UserContext_MessageReceived2(object sender, MessageEventArgs2 e)
        {
            var message     = e.Message;
            var messageType = e.MessageType;
            var sendUserID  = e.UserID;
            var userIDs     = e.Items.Select(item => item.ID).ToArray();

            if (messageType == MessageType.Notification)
            {
                if (e.UserID != this.authenticator.ID && (userIDs.Any() == false || userIDs.Any(item => item == this.authenticator.ID) == true))
                {
                    await this.Dispatcher.InvokeAsync(() =>
                    {
                        var title = string.Format(Resources.Title_AdministratorMessage_Format, sendUserID);
                        this.flashService?.Flash();
                        this.toastMessageService.Show(message, title);
                    });
                }
            }
        }
예제 #2
0
        private void UserContext_MessageReceived2(object sender, MessageEventArgs2 e)
        {
            var userID            = this.authentication.ID;
            var exceptionUserID   = e.UserID;
            var signatureDate     = e.SignatureDate;
            var userIDs           = e.Items.Select(item => item.ID).ToArray();
            var message           = e.Message;
            var messageType       = e.MessageType;
            var notifyMessageType = e.NotifyMessageType;

            this.InvokeEvent(userID, exceptionUserID, () =>
            {
                if (notifyMessageType == NotifyMessageType.Toast && CremaFeatures.SupportsToastMessage(this.clientVersion))
                {
                    this.Callback.OnMessageReceived2(signatureDate, userIDs, message, messageType, notifyMessageType);
                }
                else
                {
                    this.Callback.OnMessageReceived(signatureDate, userIDs, message, messageType);
                }
            });
        }
예제 #3
0
 protected virtual void OnMessageReceived2(MessageEventArgs2 e)
 {
     this.messageReceived2?.Invoke(this, e);
 }
 private void UserContext_UsersMessageReceived2(object sender, MessageEventArgs2 e)
 {
     this.Invoke(null);
 }
예제 #5
0
 private void Users_MessageReceived2(object sender, MessageEventArgs2 e)
 {
     this.messageReceived2?.Invoke(this, e);
 }