コード例 #1
0
        public Conversation ConversationBuilder(Envelope env)
        {
            Conversation conv = null;

            switch (env.Contents)
            {
            case StockHistoryRequestMessage m:
                conv = new StockHistoryResponseConversation(env);
                mock = new Mock <StockHistoryResponseState>(env, conv)
                {
                    CallBase = true
                };
                conv.SetInitialState(mock.Object as StockHistoryResponseState);
                break;
            }

            return(conv);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: scbrianti/Team-1
        public static Conversation ConversationBuilder(Envelope e)
        {
            Conversation conv = null;

            switch (e.Contents)
            {
            case StockHistoryRequestMessage m:
                conv = new StockHistoryResponseConversation(e);
                conv.SetInitialState(new StockHistoryResponseState(e as TcpEnvelope, conv));
                break;

            case StockStreamRequestMessage m:
                conv = new StockStreamResponseConversation(m.ConversationID);
                conv.SetInitialState(new StockStreamResponseState(e, conv));
                break;
            }

            return(conv);
        }