Advertisement
Guest User

Untitled

a guest
Sep 28th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. namespace Namespace
  2. {
  3.     public class Class()
  4.     {
  5.  
  6.         public method()
  7.         {
  8.             List<CardImage> Images = new List<CardImage>();
  9.             Images.Add(new CardImage(url: "http://dev.example.com/cat.png"));
  10.             List<CardAction> Buttons = new List<CardAction>();
  11.             Buttons.Add(new CardAction()
  12.             {
  13.                 Value = $"http://google.com",
  14.                 Type = "openUrl",
  15.                 Title = "Google"
  16.             });
  17.  
  18.             ThumbnailCard Card = new ThumbnailCard()
  19.             {
  20.                 Title = "Another Card!",
  21.                 Subtitle = "Another test card",
  22.                 Text = "This is just like a hero card, but smaller picture.",
  23.                 Images = Images,
  24.                 Buttons = Buttons
  25.             };
  26.            
  27.             try
  28.             {
  29.                 PostJsonAsync(MSTeamsCards.Config.WebHook, card.ConvertToJsonSomehow()).ContinueWith(x =>
  30.                 {
  31.                     try
  32.                     {
  33.                         Console.Write(x.Result);
  34.                     } catch(Exception e)
  35.                     {
  36.                         Console.WriteLine(e.Message);
  37.                     }
  38.                 });
  39.             } catch(Exception e)
  40.             {
  41.                 Console.WriteLine(e.Message);
  42.             }
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement