用于机器人框架版本 4 C# 的自适应卡片 nuget 包
Adaptive Cards nuget package to be used for bot frameworks version 4 C#
我不确定从第 3 版迁移过来的第 4 版机器人应用程序中的自适应卡要包含的 nuget 包。可用的选项是 AdaptiveCards nuget 包和 Microsoft.AdaptiveCards(均由 Microsoft ).在版本 3 中,我们使用了 adaptiveCards(来自 AdaptiveCards)。
我们在第 3 版应用程序中使用了自适应卡的以下 nuget 包(由 AdaptiveCards 提供)Adaptive cards,请帮助我将 nuget 包用于同一应用程序的第 4 版,以便更改在现有代码中完成的工作可能最少且节省时间。
当我在 v4 应用程序和自适应卡方法中添加建议的包时,出现错误 'AdaptiveCards is obselete. Please use the overload that accepts the version parameter and specify the version your card requires.'
自适应卡片中的一种方法Class:
//Create an adaptive card to show the SharePoint search result
public static Attachment SPSearchAdapativecard(string title, string summery, string actionUrl)
{
summery = summery.Replace("<c0>", "**");
summery = summery.Replace("</c0>", "**");
summery = summery.Replace("<ddd/>", "...");
AdaptiveCard card = new AdaptiveCard()
{
Body = new List<AdaptiveElement>()
{
new AdaptiveTextBlock()
{
Text = title,
Weight = AdaptiveTextWeight.Bolder,
Size = AdaptiveTextSize.Medium,
Wrap=false,
Separator = false,
Color= AdaptiveTextColor.Accent
},
new AdaptiveTextBlock()
{
Text = summery,
Wrap=true,
Size = AdaptiveTextSize.Small
},
},
Actions = new List<AdaptiveAction>()
{
new AdaptiveOpenUrlAction()
{
Id = "moreInfoBtn",
Title= "More Info",
Url= new Uri(actionUrl)
}
}
};
// Create the attachment with adapative card.
Attachment attachment = new Attachment()
{
ContentType = AdaptiveCard.ContentType,
Content = card
};
return attachment;
}
我不确定从第 3 版迁移过来的第 4 版机器人应用程序中的自适应卡要包含的 nuget 包。可用的选项是 AdaptiveCards nuget 包和 Microsoft.AdaptiveCards(均由 Microsoft ).在版本 3 中,我们使用了 adaptiveCards(来自 AdaptiveCards)。
我们在第 3 版应用程序中使用了自适应卡的以下 nuget 包(由 AdaptiveCards 提供)Adaptive cards,请帮助我将 nuget 包用于同一应用程序的第 4 版,以便更改在现有代码中完成的工作可能最少且节省时间。
当我在 v4 应用程序和自适应卡方法中添加建议的包时,出现错误 'AdaptiveCards is obselete. Please use the overload that accepts the version parameter and specify the version your card requires.'
自适应卡片中的一种方法Class:
//Create an adaptive card to show the SharePoint search result
public static Attachment SPSearchAdapativecard(string title, string summery, string actionUrl)
{
summery = summery.Replace("<c0>", "**");
summery = summery.Replace("</c0>", "**");
summery = summery.Replace("<ddd/>", "...");
AdaptiveCard card = new AdaptiveCard()
{
Body = new List<AdaptiveElement>()
{
new AdaptiveTextBlock()
{
Text = title,
Weight = AdaptiveTextWeight.Bolder,
Size = AdaptiveTextSize.Medium,
Wrap=false,
Separator = false,
Color= AdaptiveTextColor.Accent
},
new AdaptiveTextBlock()
{
Text = summery,
Wrap=true,
Size = AdaptiveTextSize.Small
},
},
Actions = new List<AdaptiveAction>()
{
new AdaptiveOpenUrlAction()
{
Id = "moreInfoBtn",
Title= "More Info",
Url= new Uri(actionUrl)
}
}
};
// Create the attachment with adapative card.
Attachment attachment = new Attachment()
{
ContentType = AdaptiveCard.ContentType,
Content = card
};
return attachment;
}