我不確定要從第 3 版遷移的第 4 版機器人應用程序中的自適應卡包含的 nuget 包??捎玫倪x項是 AdaptiveCards nuget 包和 Microsoft.AdaptiveCards(均由 Microsoft 提供)。在版本 3 中,我們使用了 adaptiveCards(來自 AdaptiveCards)。我們在我們的第 3 版應用程序中使用以下自適應卡的 nuget 包(由 AdaptiveCards 提供)自適應卡,請幫助我將 nuget 包用于同一應用程序的第 4 版,以便可以對現有代碼進行更改最小化和節省時間。當我在 v4 應用程序和自適應卡片方法中添加建議的包時,出現錯誤“AdaptiveCards 已過時”。請使用接受版本參數的重載并指定您的卡需要的版本。我們的自適應卡片類中的一種方法: //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; }
- 1 回答
- 0 關注
- 115 瀏覽
添加回答
舉報
0/150
提交
取消