private Cards.AdaptiveCard Parse(string json) { try { Cards.AdaptiveCardParseResult result = Cards.AdaptiveCard.FromJson(json); return(result.Card); } catch (Exception) { return(null); } }
/// <summary> /// Parse an AdaptiveCard from a JSON string /// </summary> /// <param name="json">A JSON-serialized Adaptive Card</param> /// <returns></returns> public static AdaptiveCardParseResult FromJson(string json) { var parseResult = new AdaptiveCardParseResult(); try { parseResult.Card = JsonConvert.DeserializeObject <AdaptiveCard>(json, new JsonSerializerSettings { ContractResolver = new WarningLoggingContractResolver(parseResult, new ParseContext()), Converters = { new StrictIntConverter() } }); } catch (JsonException ex) { throw new AdaptiveSerializationException(ex.Message, ex); } return(parseResult); }
public WarningLoggingContractResolver(AdaptiveCardParseResult parseResult) { _parseResult = parseResult; }
public AdaptiveCardConverter(AdaptiveCardParseResult parseResult) { _parseResult = parseResult; }
public AdaptiveTypedElementConverter(AdaptiveCardParseResult parseResult) { _parseResult = parseResult; }