public override ConversationState HandleMessage(Envelope incomingMessage)
        {
            Log.Debug($"{nameof(HandleMessage)} (enter)");

            ConversationState nextState = null;

            switch (incomingMessage.Contents)
            {
            case AckMessage m:
                nextState = new ConversationDoneState(Conversation, this);
                break;
            }

            Log.Debug($"{nameof(HandleMessage)} (exit)");
            return(nextState);
        }
예제 #2
0
        //OPTIONAL: Use the commented constructor below if state is created from an incoming message and not from some local event or action.
        //public Template_ConvState(Envelope message, Conversation conv, ConversationState previousState) : base(message, conv, previousState) { }

        public override ConversationState HandleMessage(Envelope incomingMessage)
        {
            Log.Debug($"{nameof(HandleMessage)} (enter)");

            ConversationState nextState = null;

            switch (incomingMessage.Contents)
            {
            //TODO: Add state-specific message handling here. Given the incoming message,
            //you should set nextState to the next ConversationState expected in the conversation.
            case ErrorMessage m:
                Log.Error($"Received error message as reply...\n{m.ErrorText}");
                nextState = new ConversationDoneState(Conversation, this);
                break;

            default:
                Log.Error($"No logic to process incoming message of type {incomingMessage.Contents?.GetType()}. Ignoring message.");
                break;
            }

            Log.Debug($"{nameof(HandleMessage)} (exit)");
            return(nextState);
        }