1

我的 nuget 包及其自适应卡版本。

包名称:Microsoft.AdaptiveCards 版本=0.5.1.0

当我安装这个包时,我可以看到List<ActionBase> 添加所有自适应卡片操作。

版本=0.5.1.0的代码示例:

                    List<ActionBase> actionList = new List<ActionBase>();
                    ShowCardAction action1 = new ShowCardAction();
                    action1.Title = "View Comment";
                    actionList.Add(action1);
                    ShowCardAction action2 = new ShowCardAction();
                    action2.Title = "Post Comment";
                    actionList.Add(action2);
                    OpenUrlAction action3 = new OpenUrlAction();
                    action3.Title = "View  Ticket";
                    action3.Url = "<URL>;
                    actionList.Add(action3);

包名称:AdaptiveCards 版本=1.0.0

List<ActionBase>当我安装这个软件包时,由于最新版本,我看不到。如何添加多个卡片操作?

4

1 回答 1

1

在 AdaptiveCards Version=1.0.0 中,ActionBase 已更改为 AdaptiveAction。

这应该有效:

List<AdaptiveAction> actionList = new List<AdaptiveAction>();
AdaptiveShowCardAction action1 = new AdaptiveShowCardAction();
action1.Title = "View Comment";
actionList.Add(action1);
AdaptiveShowCardAction action2 = new AdaptiveShowCardAction();
action2.Title = "Post Comment";
actionList.Add(action2);
AdaptiveOpenUrlAction action3 = new AdaptiveOpenUrlAction();
action3.Title = "View  Ticket";
action3.Url = new Uri("<URL>");
actionList.Add(action3);
于 2018-04-09T23:02:15.147 回答