示例#1
0
        public async Task SendCard(ICard card)
        {
            var message             = _context.MakeMessage();
            var connector           = new ConnectorClient(new Uri(message.ServiceUrl));
            var replyToConversation = (Activity)_context.MakeMessage();

            replyToConversation.Attachments = card.Draw();

            string cardType = card.GetType().Name;

            if (cardType == "CarouselListCard")
            {
                replyToConversation.AttachmentLayout = AttachmentLayoutTypes.Carousel;
            }

            await connector.Conversations.SendToConversationAsync(replyToConversation);
        }