有谁知道如何使用IActivityLogger
访问富卡?因为我现在无法记录富卡的属性(例如标题),但我可以使用activity.AsMessageActivity().Attachments
访问内容并使用
foreach (var attachment in attachments)
{
attachment.Content
}
但我不知道如何访问这些富卡属性?有什么办法吗?谢谢!
答案 0 :(得分:1)
通过查看附件的ContentType
属性,您将知道Attachment
的卡片类型。
之后只需将Content
属性转换为卡片类型即可。
例如:
// TODO: add switch logic to perform the corresponding cast depending the type of the card.
var heroCard = attachment.Content as HeroCard
可以通过每张卡访问卡的内容类型:
HeroCard.ContentType
ThumbnailCard.ContentType