예제 #1
0
        protected override Response OnReceive(Message message)
        {
            switch (message)
            {
            case MessageBoxReplyMessage m:
                MessageBoxReplyReceived?.InvokeAsync(new MessageBoxReplyEventArgs {
                    RequestId = m.RequestId, Result = m.Result
                });
                return(new SimpleResponse(SimpleResponsePurport.Acknowledged));

            case PasswordReplyMessage m:
                PasswordReceived?.InvokeAsync(new PasswordReplyEventArgs {
                    Password = m.Password, RequestId = m.RequestId, Success = m.Success
                });
                return(new SimpleResponse(SimpleResponsePurport.Acknowledged));

            case ReconfigurationMessage m:
                ReconfigurationRequested?.InvokeAsync(new ReconfigurationEventArgs {
                    ConfigurationPath = m.ConfigurationPath
                });
                return(new SimpleResponse(SimpleResponsePurport.Acknowledged));
            }

            return(new SimpleResponse(SimpleResponsePurport.UnknownMessage));
        }
예제 #2
0
        protected override Response OnReceive(Message message)
        {
            switch (message)
            {
            case ExamSelectionReplyMessage m:
                ExamSelectionReceived?.InvokeAsync(new ExamSelectionReplyEventArgs {
                    RequestId = m.RequestId, SelectedExamId = m.SelectedExamId, Success = m.Success
                });
                return(new SimpleResponse(SimpleResponsePurport.Acknowledged));

            case MessageBoxReplyMessage m:
                MessageBoxReplyReceived?.InvokeAsync(new MessageBoxReplyEventArgs {
                    RequestId = m.RequestId, Result = m.Result
                });
                return(new SimpleResponse(SimpleResponsePurport.Acknowledged));

            case PasswordReplyMessage m:
                PasswordReceived?.InvokeAsync(new PasswordReplyEventArgs {
                    Password = m.Password, RequestId = m.RequestId, Success = m.Success
                });
                return(new SimpleResponse(SimpleResponsePurport.Acknowledged));

            case ReconfigurationMessage m:
                ReconfigurationRequested?.InvokeAsync(new ReconfigurationEventArgs {
                    ConfigurationPath = m.ConfigurationPath
                });
                return(new SimpleResponse(SimpleResponsePurport.Acknowledged));

            case ServerFailureActionReplyMessage m:
                ServerFailureActionReceived?.InvokeAsync(new ServerFailureActionReplyEventArgs {
                    Abort = m.Abort, Fallback = m.Fallback, RequestId = m.RequestId, Retry = m.Retry
                });
                return(new SimpleResponse(SimpleResponsePurport.Acknowledged));
            }

            return(new SimpleResponse(SimpleResponsePurport.UnknownMessage));
        }