From 67cb7d2a5de27c9749e86c60a0593cd7adaa57bf Mon Sep 17 00:00:00 2001 From: Tom Laird-McConnell Date: Mon, 6 May 2024 15:32:29 -0700 Subject: [PATCH 1/5] Fixed over 2000 warnings in core libraries * disabled xml comments in internal classes for Marked * added missing xml comments on elements that should have them * removed unused vars * made libarary simply netstandard2.0 * updated packages --- .../AdaptiveCards.Net6/AdaptiveCards.csproj | 4 +- .../AdaptiveCards.Rendering.Wpf.Xceed.csproj | 4 +- .../AdaptiveCards.Rendering.Wpf.csproj | 4 +- .../AdaptiveInputValue.cs | 2 - .../AdaptiveCards.Templating.csproj | 18 ++- .../AdaptiveCards/AdaptiveAuthCardButton.cs | 3 + .../AdaptiveCards/AdaptiveAuthentication.cs | 3 + .../AdaptiveCards/AdaptiveCards.csproj | 14 +- .../AdaptiveCollectionElement.cs | 3 + .../AdaptiveCards/AdaptiveColumnSet.cs | 2 + .../AdaptiveCards/AdaptiveContainer.cs | 2 + .../Library/AdaptiveCards/AdaptiveHeight.cs | 6 + .../AdaptiveCards/AdaptiveHeightConverter.cs | 2 +- .../Library/AdaptiveCards/AdaptiveMedia.cs | 4 + .../Library/AdaptiveCards/AdaptiveRefresh.cs | 3 + .../Library/AdaptiveCards/AdaptiveTable.cs | 2 +- .../AdaptiveCards/AdaptiveTableCell.cs | 4 +- .../AdaptiveTableColumnDefinition.cs | 6 + .../Library/AdaptiveCards/AdaptiveTableRow.cs | 2 +- .../AdaptiveTokenExchangeResource.cs | 3 + .../Library/AdaptiveCards/AdaptiveWidth.cs | 8 +- .../AdaptiveCards/AdaptiveWidthConverter.cs | 2 +- .../IgnoreDefaultStringEnumConverter.cs | 2 + .../AdaptiveCards/IgnoreNullEnumConverter.cs | 2 + .../AdaptiveCards/Iso8601DateTimeConverter.cs | 3 + .../Library/AdaptiveCards/MarkedNet/Emoji.cs | 7 +- .../AdaptiveCards/MarkedNet/EmojiConverter.cs | 33 ++++- .../AdaptiveCards/MarkedNet/EmojiMarkup.cs | 7 +- .../AdaptiveCards/MarkedNet/EmojiRenderer.cs | 14 +- .../AdaptiveCards/MarkedNet/HtmlRenderer.cs | 9 +- .../MarkedNet/MarkedNet/BlockRules.cs | 4 +- .../MarkedNet/MarkedNet/InlineLexer.cs | 5 +- .../MarkedNet/MarkedNet/InlineRules.cs | 3 +- .../MarkedNet/MarkedNet/Lexer.cs | 3 +- .../MarkedNet/MarkedNet/Marked.cs | 4 +- .../MarkedNet/MarkedNet/Objects.cs | 4 +- .../MarkedNet/MarkedNet/Options.cs | 4 +- .../MarkedNet/MarkedNet/Parser.cs | 4 +- .../MarkedNet/MarkedNet/Renderer.cs | 4 +- .../MarkedNet/MarkedNet/StringHelper.cs | 4 +- .../MarkedNet/MarkedNet/Token.cs | 4 +- .../MarkedNet/MarkedNet/TokensResult.cs | 3 +- .../AdaptiveCards/MarkedNet/TextRenderer.cs | 3 +- .../AdaptiveCards/MarkedNet/XamlRenderer.cs | 27 +++- .../Rendering/AdaptiveRenderArgs.cs | 63 ++++++++- .../Rendering/AdaptiveRenderException.cs | 15 ++ .../Rendering/AdaptiveRenderTransformers.cs | 21 +++ .../Rendering/AdaptiveVisitor.cs | 132 ++++++++++++++++++ .../Rendering/ContainerStyleConfig.cs | 5 +- .../Rendering/ContainerStylesConfig.cs | 27 ++++ .../AdaptiveCards/Rendering/FactSetConfig.cs | 3 + .../Rendering/FontSizesConfig.cs | 28 ++++ .../Rendering/FontStyleConfig.cs | 14 +- .../Rendering/FontStylesConfig.cs | 14 ++ .../Rendering/FontWeightsConfig.cs | 22 +++ .../Rendering/ForegroundColorsConfig.cs | 39 +++++- .../AdaptiveCards/Rendering/HeadingsConfig.cs | 3 + .../Rendering/HighlightColorConfig.cs | 9 ++ .../AdaptiveCards/Rendering/ImageSetConfig.cs | 8 +- .../Rendering/ImageSizesConfig.cs | 12 ++ .../AdaptiveCards/Rendering/InputsConfig.cs | 7 + .../AdaptiveCards/Rendering/LabelConfig.cs | 6 + .../Rendering/RenderedAdaptiveCardBase.cs | 6 + .../Rendering/RenderedAdaptiveCardInputs.cs | 7 + .../Rendering/RendererUtilities.cs | 27 ++++ .../Rendering/SeparatorConfig.cs | 3 + .../AdaptiveCards/Rendering/SpacingsConfig.cs | 18 +++ .../Rendering/TextBlockConfig.cs | 3 + .../AdaptiveCards/SerializableDictionary.cs | 2 + .../AdaptiveCards/StrictIntConverter.cs | 12 ++ .../AdaptiveCards/ToggleElementsConverter.cs | 6 + .../AdaptiveCards/TypedEventHandler.cs | 7 + .../WarningLoggingContractResolver.cs | 2 + .../AdaptiveCards.Sample.ImageRender.csproj | 4 +- .../ImageRendererServer.csproj | 2 +- .../AdaptiveCards.Sample.WPFVisualizer.csproj | 7 +- .../AdaptiveCards.Templating.Test.csproj | 17 ++- .../TestTransform.cs | 2 +- .../AdaptiveCards.Test/AdaptiveActionTests.cs | 3 +- .../AdaptiveCards.Test.csproj | 10 +- 80 files changed, 737 insertions(+), 83 deletions(-) diff --git a/source/dotnet/Library/AdaptiveCards.Net6/AdaptiveCards.csproj b/source/dotnet/Library/AdaptiveCards.Net6/AdaptiveCards.csproj index 69fd38d1f2..01edeaf685 100644 --- a/source/dotnet/Library/AdaptiveCards.Net6/AdaptiveCards.csproj +++ b/source/dotnet/Library/AdaptiveCards.Net6/AdaptiveCards.csproj @@ -56,10 +56,10 @@ - + diff --git a/source/dotnet/Library/AdaptiveCards.Rendering.Wpf.Xceed/AdaptiveCards.Rendering.Wpf.Xceed.csproj b/source/dotnet/Library/AdaptiveCards.Rendering.Wpf.Xceed/AdaptiveCards.Rendering.Wpf.Xceed.csproj index e92c22febc..29d131bf8a 100644 --- a/source/dotnet/Library/AdaptiveCards.Rendering.Wpf.Xceed/AdaptiveCards.Rendering.Wpf.Xceed.csproj +++ b/source/dotnet/Library/AdaptiveCards.Rendering.Wpf.Xceed/AdaptiveCards.Rendering.Wpf.Xceed.csproj @@ -1,7 +1,7 @@ - net4.5.2 + net462 Microsoft Adaptive Card renderer for WPF with enhanced input controls provided by the Xceed WPF toolkit This library implements classes for rendering Adaptive Cards into WPF controls @@ -18,7 +18,7 @@ - + diff --git a/source/dotnet/Library/AdaptiveCards.Rendering.Wpf/AdaptiveCards.Rendering.Wpf.csproj b/source/dotnet/Library/AdaptiveCards.Rendering.Wpf/AdaptiveCards.Rendering.Wpf.csproj index 0e492f2f93..bea18d58d4 100644 --- a/source/dotnet/Library/AdaptiveCards.Rendering.Wpf/AdaptiveCards.Rendering.Wpf.csproj +++ b/source/dotnet/Library/AdaptiveCards.Rendering.Wpf/AdaptiveCards.Rendering.Wpf.csproj @@ -1,7 +1,7 @@  - net4.5.2 + net462 Microsoft Adaptive Card renderer for WPF This library implements classes for rendering Adaptive Cards into WPF controls @@ -17,7 +17,7 @@ - + diff --git a/source/dotnet/Library/AdaptiveCards.Rendering.Wpf/AdaptiveInputValue.cs b/source/dotnet/Library/AdaptiveCards.Rendering.Wpf/AdaptiveInputValue.cs index ecf8417798..0eff1442a6 100644 --- a/source/dotnet/Library/AdaptiveCards.Rendering.Wpf/AdaptiveInputValue.cs +++ b/source/dotnet/Library/AdaptiveCards.Rendering.Wpf/AdaptiveInputValue.cs @@ -327,8 +327,6 @@ protected string ToIso8601Time(string text) public class AdaptiveChoiceSetInputValue : AdaptiveInputValueNonEmptyValidation { - private UIElement uIElement; - public AdaptiveChoiceSetInputValue(AdaptiveChoiceSetInput inputElement, UIElement renderedElement) : base(inputElement, renderedElement) { } public AdaptiveChoiceSetInputValue(AdaptiveChoiceSetInput inputElement, UIElement renderedElement, UIElement uIElement) : base(inputElement, renderedElement, uIElement) { } diff --git a/source/dotnet/Library/AdaptiveCards.Templating/AdaptiveCards.Templating.csproj b/source/dotnet/Library/AdaptiveCards.Templating/AdaptiveCards.Templating.csproj index 0c47c7896b..b61a2c6662 100644 --- a/source/dotnet/Library/AdaptiveCards.Templating/AdaptiveCards.Templating.csproj +++ b/source/dotnet/Library/AdaptiveCards.Templating/AdaptiveCards.Templating.csproj @@ -20,6 +20,12 @@ $(MSBuildProjectDirectory)\docs\AdaptiveCardsTemplate.xml True + + 1701;1702;3021;5048 + + + 1701;1702;3021;5048 + @@ -43,16 +49,8 @@ - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveAuthCardButton.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveAuthCardButton.cs index 38e8b65274..bf021055b8 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveAuthCardButton.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveAuthCardButton.cs @@ -5,6 +5,9 @@ namespace AdaptiveCards { + /// + /// Class for AuthCardButton + /// public class AdaptiveAuthCardButton { /// diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveAuthentication.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveAuthentication.cs index 856e80fb29..5b5c97af5c 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveAuthentication.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveAuthentication.cs @@ -6,6 +6,9 @@ namespace AdaptiveCards { + /// + /// Class to for authentication data. + /// public class AdaptiveAuthentication { /// diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveCards.csproj b/source/dotnet/Library/AdaptiveCards/AdaptiveCards.csproj index eb6e145dc9..70c50123b6 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveCards.csproj +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveCards.csproj @@ -1,7 +1,7 @@  - net4.5.2;netstandard1.3;netstandard2.0 + netstandard2.0 Microsoft Adaptive Card object model for .NET This library implements classes for building and serializing adaptive card objects @@ -54,11 +54,19 @@ True + + 1701;1702; + + + + 1701;1702; + + - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveCollectionElement.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveCollectionElement.cs index 82f32af99a..a37f48c075 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveCollectionElement.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveCollectionElement.cs @@ -40,10 +40,13 @@ public abstract class AdaptiveCollectionElement : AdaptiveElement, IEnumerable public bool ShouldSerializeStyleXml() => this.Style.HasValue; #endif + /// public abstract IEnumerator GetEnumerator(); + /// public abstract void Add(AdaptiveElement value); + /// IEnumerator IEnumerable.GetEnumerator() { throw new System.NotImplementedException(); diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveColumnSet.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveColumnSet.cs index 5ecaeab692..3f0b81528b 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveColumnSet.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveColumnSet.cs @@ -33,11 +33,13 @@ public class AdaptiveColumnSet : AdaptiveCollectionElement #endif public List Columns { get; set; } = new List(); + /// public override IEnumerator GetEnumerator() { return Columns.GetEnumerator(); } + /// public override void Add(AdaptiveElement element) { if (element is AdaptiveColumn) diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveContainer.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveContainer.cs index a01b16aeb0..f676d29254 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveContainer.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveContainer.cs @@ -88,11 +88,13 @@ public class AdaptiveContainer : AdaptiveCollectionElement public bool ShouldSerializeRtlXml() => this.Rtl.HasValue; #endif + /// public override IEnumerator GetEnumerator() { return Items.GetEnumerator(); } + /// public override void Add(AdaptiveElement element) { Items.Add(element); diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveHeight.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveHeight.cs index 9250737b6d..d08deef81d 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveHeight.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveHeight.cs @@ -80,6 +80,11 @@ public AdaptiveHeight(string value) } } + /// + /// Parse string to adaptive height + /// + /// string value + /// AdaptiveHeight public static AdaptiveHeight Parse(string value) { return new AdaptiveHeight(value); @@ -239,6 +244,7 @@ public Boolean Equals(AdaptiveHeight other) return false; } + /// public override string ToString() { if (HeightType == AdaptiveHeightType.Stretch) diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveHeightConverter.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveHeightConverter.cs index 146221ffcb..8611ed33a8 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveHeightConverter.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveHeightConverter.cs @@ -28,7 +28,7 @@ public override AdaptiveHeight ReadJson(JsonReader reader, Type objectType, Adap { return AdaptiveHeight.Parse(value); } - catch (Exception err) + catch (Exception) { if (value.Length < 3) { diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveMedia.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveMedia.cs index d4b581ae2c..4894509f99 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveMedia.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveMedia.cs @@ -64,6 +64,10 @@ public class AdaptiveMedia : AdaptiveElement [DefaultValue(null)] public List CaptionSources { get; set; } = new List(); + /// + /// XmlSerializer method + /// + /// public bool ShouldSerializeCaptionSources() => CaptionSources.Any(); } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveRefresh.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveRefresh.cs index 682419dfd2..a88a347536 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveRefresh.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveRefresh.cs @@ -52,6 +52,9 @@ public class AdaptiveRefresh public DateTime? Expires { get; set; } #if !NETSTANDARD1_3 + /// + /// Internal property for serializing xml. + /// [XmlAttribute] [JsonIgnore] public string ExpiresXml { get => Expires?.ToString("yyyy-MM-ddTHH:mm:ssZ", CultureInfo.InvariantCulture); set => Expires = DateTime.Parse(value); } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTable.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTable.cs index 3a89303d51..e3e8090c65 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTable.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTable.cs @@ -86,7 +86,7 @@ public override void Add(AdaptiveElement element) /// /// Determines whether to serialize the style for XML. /// - public bool ShouldSerializeStyleXml() => this.GridStyle.HasValue; + public bool ShouldSerializeGridStyleXml() => this.GridStyle.HasValue; #endif /// diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTableCell.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTableCell.cs index 26152838f9..51a43a4473 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTableCell.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTableCell.cs @@ -18,7 +18,7 @@ namespace AdaptiveCards public class AdaptiveTableCell : AdaptiveCollectionWithContentAlignment { /// - public new const string TypeName = "TableCell"; + public const string TypeName = "TableCell"; /// #if !NETSTANDARD1_3 @@ -79,11 +79,13 @@ public class AdaptiveTableCell : AdaptiveCollectionWithContentAlignment #endif public List Items { get; set; } = new List(); + /// public override IEnumerator GetEnumerator() { return Items.GetEnumerator(); } + /// public override void Add(AdaptiveElement element) { Items.Add(element); diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTableColumnDefinition.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTableColumnDefinition.cs index d9405a6974..516d317456 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTableColumnDefinition.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTableColumnDefinition.cs @@ -51,6 +51,9 @@ public class AdaptiveTableColumnDefinition [DefaultValue(0)] private TableColumnWidth TableColumnWidth { get; set; } = new TableColumnWidth(); + /// + /// Ths width in pixels + /// [JsonIgnore] public double PixelWidth { @@ -58,6 +61,9 @@ public double PixelWidth set { TableColumnWidth.PixelWidth = value; } } + /// + /// Ths relative width as a weight + /// [JsonIgnore] public double Width { diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTableRow.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTableRow.cs index 193bd92eae..509cf9601e 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTableRow.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTableRow.cs @@ -43,7 +43,7 @@ public override IEnumerator GetEnumerator() return Cells.GetEnumerator(); } - + /// public override void Add(AdaptiveElement value) { if (value is AdaptiveTableCell cell) diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTokenExchangeResource.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTokenExchangeResource.cs index 396e3ca299..cb60f84f3e 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTokenExchangeResource.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTokenExchangeResource.cs @@ -5,6 +5,9 @@ namespace AdaptiveCards { + /// + /// Class for TokenExchangeResource + /// public class AdaptiveTokenExchangeResource { /// diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveWidth.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveWidth.cs index a0cf2a245f..243be9998c 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveWidth.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveWidth.cs @@ -81,6 +81,11 @@ public AdaptiveWidth(string value) } } + /// + /// Parse string into AdaptiveWidth + /// + /// string + /// AdaptiveWidth public static AdaptiveWidth Parse(string value) { return new AdaptiveWidth(value); @@ -99,7 +104,7 @@ public AdaptiveWidth(uint px) /// /// Initializes an AdaptiveWidth instance with the given . /// - /// The AdaptiveWidthType to use. + /// The AdaptiveWidthType to use. public AdaptiveWidth(AdaptiveWidthType widthType) { WidthType = widthType; @@ -240,6 +245,7 @@ public Boolean Equals(AdaptiveWidth other) return false; } + /// public override string ToString() { if (WidthType == AdaptiveWidthType.Stretch) diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveWidthConverter.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveWidthConverter.cs index 10d2d1da43..d712e9f197 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveWidthConverter.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveWidthConverter.cs @@ -29,7 +29,7 @@ public override AdaptiveWidth ReadJson(JsonReader reader, Type objectType, Adapt { return AdaptiveWidth.Parse(value); } - catch (Exception err) + catch (Exception) { if (value.Length < 3) { diff --git a/source/dotnet/Library/AdaptiveCards/IgnoreDefaultStringEnumConverter.cs b/source/dotnet/Library/AdaptiveCards/IgnoreDefaultStringEnumConverter.cs index e5a84aaa44..e731eb6996 100644 --- a/source/dotnet/Library/AdaptiveCards/IgnoreDefaultStringEnumConverter.cs +++ b/source/dotnet/Library/AdaptiveCards/IgnoreDefaultStringEnumConverter.cs @@ -27,7 +27,9 @@ public IgnoreDefaultStringEnumConverter() defaultValue = GetDefaultValueFromEnum(); } +#pragma warning disable CS0618 // Type or member is obsolete public IgnoreDefaultStringEnumConverter(bool camelCaseText) : base(camelCaseText) +#pragma warning restore CS0618 // Type or member is obsolete { defaultValue = GetDefaultValueFromEnum(); } diff --git a/source/dotnet/Library/AdaptiveCards/IgnoreNullEnumConverter.cs b/source/dotnet/Library/AdaptiveCards/IgnoreNullEnumConverter.cs index a6481e8302..81b39eb0d5 100644 --- a/source/dotnet/Library/AdaptiveCards/IgnoreNullEnumConverter.cs +++ b/source/dotnet/Library/AdaptiveCards/IgnoreNullEnumConverter.cs @@ -24,7 +24,9 @@ public IgnoreNullEnumConverter() } /// +#pragma warning disable CS0618 // Type or member is obsolete public IgnoreNullEnumConverter(bool camelCase) : base(camelCase) +#pragma warning restore CS0618 // Type or member is obsolete { } diff --git a/source/dotnet/Library/AdaptiveCards/Iso8601DateTimeConverter.cs b/source/dotnet/Library/AdaptiveCards/Iso8601DateTimeConverter.cs index 77dbda3fad..824be31f2e 100644 --- a/source/dotnet/Library/AdaptiveCards/Iso8601DateTimeConverter.cs +++ b/source/dotnet/Library/AdaptiveCards/Iso8601DateTimeConverter.cs @@ -13,6 +13,9 @@ namespace AdaptiveCards /// public class Iso8601DateTimeConverter : IsoDateTimeConverter { + /// + /// Constructor + /// public Iso8601DateTimeConverter() : base() { DateTimeFormat = "yyyy-MM-ddTHH:mm:ssZ"; diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/Emoji.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/Emoji.cs index a3ef564de2..c39aeeaf0d 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/Emoji.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/Emoji.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,8 +6,12 @@ namespace Microsoft.MarkedNet { + /// + /// Emoji to Char constants + /// public static class Emoji { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public readonly static string copyright = Char.ConvertFromUtf32(0x00A9); public readonly static string registered = Char.ConvertFromUtf32(0x00AE); public readonly static string bangbang = Char.ConvertFromUtf32(0x203C); @@ -1289,5 +1293,6 @@ public static class Emoji public readonly static string flag_za = Char.ConvertFromUtf32(0x1F1FF) + Char.ConvertFromUtf32(0x1F1E6); public readonly static string flag_zm = Char.ConvertFromUtf32(0x1F1FF) + Char.ConvertFromUtf32(0x1F1F2); public readonly static string flag_zw = Char.ConvertFromUtf32(0x1F1FF) + Char.ConvertFromUtf32(0x1F1FC); +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member } } diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/EmojiConverter.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/EmojiConverter.cs index 2f22bfa4f0..db72e12710 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/EmojiConverter.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/EmojiConverter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -8,6 +8,9 @@ namespace Microsoft.MarkedNet { + /// + /// Converter for Emoji - defines maps from symbol to Char and symbol to markup. + /// public static class EmojiConverter { private static Dictionary markup2Emoji = new Dictionary(); @@ -1298,6 +1301,14 @@ static EmojiConverter() Add("regional indicator symbol letters zw", ":flag-zw:", 0x1F1FF, 0x1F1FC); } + /// + /// Add a new definition + /// + /// + /// + /// + /// + /// public static void Add(string name, string markup, int code1, int? code2 = null, int? code3 = null) { string emoji = Char.ConvertFromUtf32(code1); @@ -1310,7 +1321,7 @@ public static void Add(string name, string markup, int code1, int? code2 = null, { markup2Emoji.Add(markup, emoji); } - catch (ArgumentException err) + catch (ArgumentException) { #if NET452 Trace.TraceError($"Failed to add {markup} because: {err.Message}"); @@ -1320,7 +1331,7 @@ public static void Add(string name, string markup, int code1, int? code2 = null, { emoji2Markup.Add(emoji, markup); } - catch (ArgumentException err) + catch (ArgumentException) { #if NET452 Trace.TraceError($"Failed to add {emoji} because: {err.Message}"); @@ -1329,12 +1340,23 @@ public static void Add(string name, string markup, int code1, int? code2 = null, } + /// + /// Table of markup to emojii chars + /// public static Dictionary Markup2Emoji { get { return markup2Emoji; } } + /// + /// Table of emoji to markup + /// public static Dictionary Emoji2Markup { get { return emoji2Markup; } } private static Regex MarkupRegex = new Regex(@"(:[^:\s]+:)", RegexOptions.Compiled); + /// + /// Convert markup to emoji chars + /// + /// + /// public static string ConvertMarkupToEmoji(string markup) { StringBuilder sb = new StringBuilder(markup); @@ -1351,6 +1373,11 @@ public static string ConvertMarkupToEmoji(string markup) return sb.ToString(); } + /// + /// Converts emojichars to markup + /// + /// + /// public static string ConvertEmojiToMarkup(string emojiText) { StringBuilder sb = new StringBuilder(emojiText); diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/EmojiMarkup.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/EmojiMarkup.cs index 0a37317cd2..02c57fa6a1 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/EmojiMarkup.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/EmojiMarkup.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,8 +6,12 @@ namespace Microsoft.MarkedNet { + /// + /// Emoji to markup constants + /// public static class EmojiMarkup { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public const string copyright = ":copyright:"; public const string registered = ":registered:"; public const string bangbang = ":bangbang:"; @@ -1287,5 +1291,6 @@ public static class EmojiMarkup public const string flag_za = ":flag-za:"; public const string flag_zm = ":flag-zm:"; public const string flag_zw = ":flag-zw:"; +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member } } diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/EmojiRenderer.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/EmojiRenderer.cs index 2240a71bd7..6340975abf 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/EmojiRenderer.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/EmojiRenderer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -12,14 +12,26 @@ namespace Microsoft.MarkedNet /// public class EmojiMarkdownRenderer : MarkdownRenderer { + /// + /// Constructor + /// public EmojiMarkdownRenderer() : base() { } + /// + /// Constructor with options + /// + /// public EmojiMarkdownRenderer(Options options) : base(options) { } + /// + /// Process text before it's used. + /// + /// + /// public override string Preprocess(string text) { return EmojiConverter.ConvertMarkupToEmoji(text); diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/HtmlRenderer.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/HtmlRenderer.cs index dd0cb42d8b..f0654c3c03 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/HtmlRenderer.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/HtmlRenderer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -12,10 +12,17 @@ namespace Microsoft.MarkedNet /// public class HtmlRenderer : EmojiMarkdownRenderer { + /// + /// Constructor + /// public HtmlRenderer() : base() { } + /// + /// Constructor with options. + /// + /// public HtmlRenderer(Options options) : base(options) { } diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/BlockRules.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/BlockRules.cs index 5528545684..92c51df5f6 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/BlockRules.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/BlockRules.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -7,6 +7,7 @@ namespace Microsoft.MarkedNet { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member /// /// Block-Level Grammar /// @@ -103,4 +104,5 @@ public class TablesBlockRules : GfmBlockRules #endregion } +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member } diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/InlineLexer.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/InlineLexer.cs index ed2b51d531..34e8f32657 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/InlineLexer.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/InlineLexer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -7,8 +7,9 @@ namespace Microsoft.MarkedNet { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member /// - /// Inline Lexer & Compiler + /// Inline Lexer Compiler /// public class InlineLexer { diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/InlineRules.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/InlineRules.cs index 69a21df0e9..0eda7bb341 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/InlineRules.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/InlineRules.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -7,6 +7,7 @@ namespace Microsoft.MarkedNet { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member /// /// Inline-Level Grammar /// diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Lexer.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Lexer.cs index 0f422ffca6..ff6319c507 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Lexer.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Lexer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -7,6 +7,7 @@ namespace Microsoft.MarkedNet { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public class Lexer { private Options _options; diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Marked.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Marked.cs index c0dda598af..960391ceb7 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Marked.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Marked.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,6 +6,7 @@ namespace Microsoft.MarkedNet { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public class Marked { public Options Options { get; set; } @@ -35,4 +36,5 @@ public virtual string Parse(string src) return Options.Renderer.Postprocess(result); } } +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member } diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Objects.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Objects.cs index d8de265e2b..3786d64603 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Objects.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Objects.cs @@ -1,10 +1,11 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Microsoft.MarkedNet { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public class TableCellFlags { public bool Header { get; set; } @@ -16,4 +17,5 @@ public class LinkObj public string Href { get; set; } public string Title { get; set; } } +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member } diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Options.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Options.cs index db7ddd0d02..38679f26da 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Options.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Options.cs @@ -1,10 +1,11 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Microsoft.MarkedNet { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public class Options { #region Fields @@ -75,4 +76,5 @@ public Options() #endregion } +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member } diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Parser.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Parser.cs index db4bc82488..638113fbc8 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Parser.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Parser.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,6 +6,7 @@ namespace Microsoft.MarkedNet { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public class Parser { private Options _options; @@ -204,4 +205,5 @@ protected virtual string Tok() throw new Exception(); } } +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member } diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Renderer.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Renderer.cs index 0e69e8a315..371c9bd2fc 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Renderer.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Renderer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -7,6 +7,7 @@ namespace Microsoft.MarkedNet { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public class MarkdownRenderer { #region Properties @@ -233,4 +234,5 @@ public virtual string Postprocess(string text) #endregion } +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member } diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/StringHelper.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/StringHelper.cs index 5fdb2f891c..b52c3a0dab 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/StringHelper.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/StringHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,6 +6,7 @@ namespace Microsoft.MarkedNet { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public static class StringHelper { public static string DecodeURIComponent(string str) @@ -72,4 +73,5 @@ public static string[] Match(this string src, Regex regex) return regex.Matches(src).Cast().Select(x => x.Value).ToArray(); } } +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member } diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Token.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Token.cs index eae8b66eea..6640bde666 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Token.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/Token.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,6 +6,7 @@ namespace Microsoft.MarkedNet { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public class Token { public string Text { get; set; } @@ -25,4 +26,5 @@ public class Token public IList Align { get; set; } public IList> Cells { get; set; } } +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member } diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/TokensResult.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/TokensResult.cs index f31825b3db..495451d872 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/TokensResult.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/MarkedNet/TokensResult.cs @@ -1,10 +1,11 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Microsoft.MarkedNet { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public class TokensResult { public IList Tokens { get; set; } diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/TextRenderer.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/TextRenderer.cs index 21f3e067bc..82288e7345 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/TextRenderer.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/TextRenderer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -7,6 +7,7 @@ namespace Microsoft.MarkedNet { +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member /// /// Renderer which renders to pure text environments like SMS /// diff --git a/source/dotnet/Library/AdaptiveCards/MarkedNet/XamlRenderer.cs b/source/dotnet/Library/AdaptiveCards/MarkedNet/XamlRenderer.cs index cc19a7fd2e..6f0c74681c 100644 --- a/source/dotnet/Library/AdaptiveCards/MarkedNet/XamlRenderer.cs +++ b/source/dotnet/Library/AdaptiveCards/MarkedNet/XamlRenderer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -12,6 +12,9 @@ namespace Microsoft.MarkedNet /// public class XamlRenderer : EmojiMarkdownRenderer { + /// + /// Constructor + /// public XamlRenderer() : base() { } @@ -81,55 +84,69 @@ public XamlRenderer() : base() /// public string ListItemStyle { get; set; } = String.Empty; + /// + /// Constructor for renderer + /// + /// public XamlRenderer(Options options) : base(options) { } + /// public override string Blockquote(string quote) { return quote.Replace(ParagraphStyle, BlockQuoteStyle); } + /// public override string Br() { return "\n"; } + /// public override string Code(string code, string lang, bool escaped) { return $"" + code.Replace("\r\n", "") + "\n"; } + /// public override string Codespan(string text) { return $"{text}\n"; } + /// public override string Del(string text) { return $"{text}"; } + /// public override string Em(string text) { return $"{text}"; } + /// public override string Heading(string text, int level, string raw) { return $"{text}\n"; } + /// public override string Hr() { return "_____________________________\n"; } + /// public override string Html(string html) { return String.Empty; } + /// public override string Image(string href, string title, string text) { StringBuilder sb = new StringBuilder(); @@ -141,11 +158,13 @@ public override string Image(string href, string title, string text) return sb.ToString(); } + /// public override string Link(string href, string title, string text) { return $"{text}"; } + /// public override string List(string body, bool ordered, int start) { StringBuilder sb = new StringBuilder(); @@ -158,11 +177,13 @@ public override string List(string body, bool ordered, int start) return sb.ToString(); } + /// public override string ListItem(string text) { return $"{Paragraph(text)}\n"; } + /// public override string Paragraph(string text) { if (text.StartsWith("{text}\n"; } + /// public override string Strong(string text) { return $"{text}"; } + /// public override string Table(string header, string body) { StringBuilder sb = new StringBuilder(); @@ -186,12 +209,14 @@ public override string Table(string header, string body) return sb.ToString(); } + /// public override string TableRow(string content) { return $"{content}\n"; } + /// public override string TableCell(string content, TableCellFlags flags) { StringBuilder sb = new StringBuilder(); diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveRenderArgs.cs b/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveRenderArgs.cs index cddd9cfc45..a167562cb4 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveRenderArgs.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveRenderArgs.cs @@ -9,20 +9,56 @@ // This class contains all properties that are used for rendering and need to be passed down between parent and child elements namespace AdaptiveCards.Rendering { + /// + /// Adaptive Bleed Direction (these are flags and so can be combined.) + /// public enum BleedDirection { - BleedNone = 0x0000, - BleedLeft = 0x0001, + /// + /// no bleed + /// + BleedNone = 0x0000, + + /// + /// bleed left + /// + BleedLeft = 0x0001, + + /// + /// bleed right + /// BleedRight = 0x0010, - BleedUp = 0x0100, - BleedDown = 0x1000, - BleedAll = 0x1111 + + /// + /// Bleed up + /// + BleedUp = 0x0100, + + /// + /// Bleed down + /// + BleedDown = 0x1000, + + /// + /// Bleed in all directions. + /// + BleedAll = 0x1111 }; + /// + /// Render args + /// public class AdaptiveRenderArgs { + /// + /// Constructor + /// public AdaptiveRenderArgs() { } + /// + /// Constructor with parameters + /// + /// public AdaptiveRenderArgs(AdaptiveRenderArgs previousRenderArgs) { ParentStyle = previousRenderArgs.ParentStyle; @@ -32,16 +68,29 @@ public AdaptiveRenderArgs(AdaptiveRenderArgs previousRenderArgs) ContainerCardId = previousRenderArgs.ContainerCardId; } - // Default value for the container style of the first adaptiveCard + /// + /// Default value for the container style of the first adaptiveCard + /// public AdaptiveContainerStyle ParentStyle { get; set; } = AdaptiveContainerStyle.Default; + /// + /// ForegoundColors config to use. + /// public ForegroundColorsConfig ForegroundColors { get; set; } - // Default value for the direction where the elements of the adaptive card can bleed to + /// + /// Bleed direction + /// public BleedDirection BleedDirection { get; set; } = BleedDirection.BleedAll; + /// + /// Flag for wether the parent already has padding. + /// public bool HasParentWithPadding { get; set; } = true; + /// + /// ContainerId context. + /// public AdaptiveInternalID ContainerCardId { get; set; } = new AdaptiveInternalID(); } } diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveRenderException.cs b/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveRenderException.cs index d7298972f8..4e2b399ed4 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveRenderException.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveRenderException.cs @@ -4,17 +4,32 @@ namespace AdaptiveCards.Rendering { + /// + /// Execption for adaptive renderer + /// public class AdaptiveRenderException : AdaptiveException { + /// + /// Constructor + /// public AdaptiveRenderException() { } + /// + /// Constructor with message + /// + /// public AdaptiveRenderException(string message) : base(message) { } + /// + /// Constructor with message and inner exception + /// + /// + /// public AdaptiveRenderException(string message, Exception innerException) : base(message, innerException) { } diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveRenderTransformers.cs b/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveRenderTransformers.cs index 695581913e..6a745033af 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveRenderTransformers.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveRenderTransformers.cs @@ -5,24 +5,45 @@ namespace AdaptiveCards.Rendering { + /// + /// Class for transforming elements. + /// + /// + /// public class AdaptiveRenderTransformers where TUIElement : class where TContext : class { private readonly Dictionary> _dictionary = new Dictionary>(); + /// + /// Register + /// + /// + /// public void Register(Action transformer) where TElement : AdaptiveTypedElement { _dictionary[typeof(TElement)] = (typedElement, uiElement, context) => transformer((TElement)typedElement, uiElement, context); } + /// + /// Remove + /// + /// public void Remove() where TElement : AdaptiveTypedElement { _dictionary.Remove(typeof(TElement)); } + /// + /// Apply + /// + /// + /// + /// + /// public void Apply(TElement element, TUIElement uiElement, TContext context) where TElement : AdaptiveTypedElement { diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveVisitor.cs b/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveVisitor.cs index 43c4868d57..8ddff1eb77 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveVisitor.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/AdaptiveVisitor.cs @@ -11,8 +11,16 @@ namespace AdaptiveCards.Rendering /// public class AdaptiveVisitor { + + /// + /// A hashset of each object found while visiting. This is useful for finding an element using Linq + /// public HashSet Elements { get; set; } = new HashSet(); + /// + /// Visit an element + /// + /// public virtual void Visit(AdaptiveElement adaptiveElement) { if (adaptiveElement is AdaptiveImage image) @@ -65,6 +73,10 @@ public virtual void Visit(AdaptiveElement adaptiveElement) Visit(table); } + /// + /// Visit a card + /// + /// public virtual void Visit(AdaptiveCard card) { if (card == null) @@ -95,6 +107,10 @@ public virtual void Visit(AdaptiveCard card) } } + /// + /// Visit a container + /// + /// public virtual void Visit(AdaptiveContainer container) { Elements.Add(container); @@ -110,6 +126,10 @@ public virtual void Visit(AdaptiveContainer container) } } + /// + /// Visit a columnSet + /// + /// public virtual void Visit(AdaptiveColumnSet columnSet) { Elements.Add(columnSet); @@ -125,6 +145,10 @@ public virtual void Visit(AdaptiveColumnSet columnSet) } } + /// + /// Visit a factset + /// + /// public virtual void Visit(AdaptiveFactSet factSet) { Elements.Add(factSet); @@ -135,6 +159,10 @@ public virtual void Visit(AdaptiveFactSet factSet) } } + /// + /// Visit an imagesset. + /// + /// public virtual void Visit(AdaptiveImageSet imageSet) { Elements.Add(imageSet); @@ -145,11 +173,19 @@ public virtual void Visit(AdaptiveImageSet imageSet) } } + /// + /// Visit a textblock + /// + /// public virtual void Visit(AdaptiveTextBlock textBlock) { Elements.Add(textBlock); } + /// + /// Visit a image + /// + /// public virtual void Visit(AdaptiveImage image) { Elements.Add(image); @@ -160,10 +196,18 @@ public virtual void Visit(AdaptiveImage image) } } + /// + /// Visit a Fact. + /// + /// public virtual void Visit(AdaptiveFact fact) { } + /// + /// Visit a textInput + /// + /// public virtual void Visit(AdaptiveTextInput inputText) { Elements.Add(inputText); @@ -174,31 +218,55 @@ public virtual void Visit(AdaptiveTextInput inputText) } } + /// + /// Visit a Date Input + /// + /// public virtual void Visit(AdaptiveDateInput inputDate) { Elements.Add(inputDate); } + /// + /// Visit a Number Input + /// + /// public virtual void Visit(AdaptiveNumberInput inputNumber) { Elements.Add(inputNumber); } + /// + /// Visit a time input + /// + /// public virtual void Visit(AdaptiveTimeInput inputTime) { Elements.Add(inputTime); } + /// + /// Visit a toggle input + /// + /// public virtual void Visit(AdaptiveToggleInput inputToggle) { Elements.Add(inputToggle); } + /// + /// Visit a choiceSet Input + /// + /// public virtual void Visit(AdaptiveChoiceSetInput adaptiveChoiceSetInput) { Elements.Add(adaptiveChoiceSetInput); } + /// + /// Visit a actionSet + /// + /// public virtual void Visit(AdaptiveActionSet actionSet) { Elements.Add(actionSet); @@ -208,6 +276,10 @@ public virtual void Visit(AdaptiveActionSet actionSet) } } + /// + /// Visit an action + /// + /// public virtual void Visit(AdaptiveAction action) { if (action is AdaptiveOpenUrlAction urlAction) @@ -226,22 +298,38 @@ public virtual void Visit(AdaptiveAction action) Visit(executeAction); } + /// + /// Visit a submit action + /// + /// public virtual void Visit(AdaptiveSubmitAction action) { Elements.Add(action); } + /// + /// Visit a OpenUrlAction + /// + /// public virtual void Visit(AdaptiveOpenUrlAction action) { Elements.Add(action); } + /// + /// Visit a showCard action + /// + /// public virtual void Visit(AdaptiveShowCardAction action) { Elements.Add(action); Visit(action.Card); } + /// + /// Visit a toggle visibility action. + /// + /// public virtual void Visit(AdaptiveToggleVisibilityAction action) { Elements.Add(action); @@ -252,21 +340,37 @@ public virtual void Visit(AdaptiveToggleVisibilityAction action) } } + /// + /// Visit a targetElement. + /// + /// public virtual void Visit(AdaptiveTargetElement targetElement) { } + /// + /// Visit a execute Action. + /// + /// public virtual void Visit(AdaptiveExecuteAction action) { Elements.Add(action); } + /// + /// Visit a Media element + /// + /// public virtual void Visit(AdaptiveMedia media) { Elements.Add(media); } + /// + /// Visit a RichTextBlock + /// + /// public virtual void Visit(AdaptiveRichTextBlock rtb) { Elements.Add(rtb); @@ -277,6 +381,10 @@ public virtual void Visit(AdaptiveRichTextBlock rtb) } } + /// + /// Visit an Inline element + /// + /// public virtual void Visit(AdaptiveInline inline) { if (inline is AdaptiveTextRun run) @@ -285,6 +393,10 @@ public virtual void Visit(AdaptiveInline inline) } } + /// + /// Visit a textRun + /// + /// public virtual void Visit(AdaptiveTextRun run) { if (run.SelectAction != null) @@ -293,6 +405,10 @@ public virtual void Visit(AdaptiveTextRun run) } } + /// + /// Visit refresh + /// + /// public virtual void Visit(AdaptiveRefresh refresh) { if (refresh.Action != null) @@ -301,6 +417,10 @@ public virtual void Visit(AdaptiveRefresh refresh) } } + /// + /// Visit table + /// + /// public virtual void Visit(AdaptiveTable table) { Elements.Add(table); @@ -316,6 +436,10 @@ public virtual void Visit(AdaptiveTable table) } } + /// + /// Visit TableRow + /// + /// public virtual void Visit(AdaptiveTableRow row) { foreach (var cell in row.Cells) @@ -324,10 +448,18 @@ public virtual void Visit(AdaptiveTableRow row) } } + /// + /// Visit TableColumnDefinition + /// + /// public virtual void Visit(AdaptiveTableColumnDefinition col) { } + /// + /// Visit table cell + /// + /// public virtual void Visit(AdaptiveTableCell cell) { foreach (var item in cell.Items) diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/ContainerStyleConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/ContainerStyleConfig.cs index da2d07fb3f..51daf6dd48 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/ContainerStyleConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/ContainerStyleConfig.cs @@ -5,11 +5,12 @@ namespace AdaptiveCards.Rendering { + /// + /// Class ContainersStyleConfig + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class ContainerStyleConfig { - public ContainerStyleConfig() { } - /// /// The background color to use for this container /// diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/ContainerStylesConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/ContainerStylesConfig.cs index 512826d842..cf8085805d 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/ContainerStylesConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/ContainerStylesConfig.cs @@ -5,18 +5,30 @@ namespace AdaptiveCards.Rendering { + /// + /// ContainerStylesConfig + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class ContainerStylesConfig { + /// + /// Default Style config + /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public ContainerStyleConfig Default { get; set; } = new ContainerStyleConfig(); + /// + /// Emphasis style config + /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public ContainerStyleConfig Emphasis { get; set; } = new ContainerStyleConfig() { BackgroundColor = "#08000000" }; + /// + /// Good style confing + /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public ContainerStyleConfig Good { get; set; } = new ContainerStyleConfig() { @@ -24,6 +36,10 @@ public class ContainerStylesConfig ForegroundColors = alternateForegroundColors }; + + /// + /// Warning style config + /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public ContainerStyleConfig Warning { get; set; } = new ContainerStyleConfig() { @@ -31,6 +47,9 @@ public class ContainerStylesConfig ForegroundColors = alternateForegroundColors }; + /// + /// Attention style config + /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public ContainerStyleConfig Attention { get; set; } = new ContainerStyleConfig() { @@ -38,6 +57,9 @@ public class ContainerStylesConfig ForegroundColors = alternateForegroundColors }; + /// + /// Accent style config + /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public ContainerStyleConfig Accent { get; set; } = new ContainerStyleConfig() { @@ -50,6 +72,11 @@ public class ContainerStylesConfig Warning = new FontColorConfig("#ffa600", "#B2ffa600") }; + /// + /// Given a style return the config for the style. + /// + /// style to lookup + /// configuration for that style. public ContainerStyleConfig GetContainerStyleConfig(AdaptiveContainerStyle? style) { switch (style) diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/FactSetConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/FactSetConfig.cs index 33e421ccc7..14a0d0f982 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/FactSetConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/FactSetConfig.cs @@ -5,6 +5,9 @@ namespace AdaptiveCards.Rendering { + /// + /// FactSetConfig + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class FactSetConfig { diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/FontSizesConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/FontSizesConfig.cs index 6f0a7bb2e7..c722005507 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/FontSizesConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/FontSizesConfig.cs @@ -6,19 +6,42 @@ namespace AdaptiveCards.Rendering { + /// + /// FontSizes conffig + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class FontSizesConfig { + /// + /// font size for small + /// public int? Small { get; set; } + /// + /// font size for default + /// public int? Default { get; set; } + /// + /// font size for medium + /// public int? Medium { get; set; } + /// + /// font size for large + /// public int? Large { get; set; } + /// + /// font size for extra large + /// public int? ExtraLarge { get; set; } + /// + /// Given AdaptiveTextSize get the font size in real size. + /// + /// + /// public int? GetFontSize(AdaptiveTextSize fontSize) { switch (fontSize) @@ -37,6 +60,11 @@ public class FontSizesConfig } } + /// + /// Given a textSize return the default font size. + /// + /// + /// public static int GetDefaultFontSize(AdaptiveTextSize fontSize) { switch (fontSize) diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/FontStyleConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/FontStyleConfig.cs index e210264a74..b6e47cf2d4 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/FontStyleConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/FontStyleConfig.cs @@ -5,17 +5,27 @@ namespace AdaptiveCards.Rendering { + /// + /// FontStyle config + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class FontStyleConfig { - public FontStyleConfig() { } - + /// + /// Font family + /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public string FontFamily { get; set; } + /// + /// FontSizes Config + /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public FontSizesConfig FontSizes { get; set; } = new FontSizesConfig(); + /// + /// FontWeights config + /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public FontWeightsConfig FontWeights { get; set; } = new FontWeightsConfig(); } diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/FontStylesConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/FontStylesConfig.cs index d269befe01..e94cb8555c 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/FontStylesConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/FontStylesConfig.cs @@ -5,15 +5,29 @@ namespace AdaptiveCards.Rendering { + /// + /// FontTypes config + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class FontTypesConfig { + /// + /// Default config + /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public FontStyleConfig Default { get; set; } = new FontStyleConfig(); + /// + /// Monospace congfig + /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public FontStyleConfig Monospace { get; set; } = new FontStyleConfig(); + /// + /// Given a fontType get the fontstyle config for ti. + /// + /// + /// public FontStyleConfig GetFontType(AdaptiveFontType fontType) { switch (fontType) diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/FontWeightsConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/FontWeightsConfig.cs index a899908b36..7ec59f1a29 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/FontWeightsConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/FontWeightsConfig.cs @@ -5,15 +5,32 @@ namespace AdaptiveCards.Rendering { + /// + /// FontWeight config + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class FontWeightsConfig { + /// + /// Lighter config + /// public int? Lighter { get; set; } + /// + /// Default confing + /// public int? Default { get; set; } + /// + /// Bolder config + /// public int? Bolder { get; set; } + /// + /// Given a textWeight get the fontweight config for it. + /// + /// + /// public int? GetFontWeight(AdaptiveTextWeight fontWeight) { switch (fontWeight) @@ -28,6 +45,11 @@ public class FontWeightsConfig } } + /// + /// Given a text weight get the default font weight for it. + /// + /// + /// public static int GetDefaultFontWeight(AdaptiveTextWeight fontWeight) { switch (fontWeight) diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/ForegroundColorsConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/ForegroundColorsConfig.cs index 3101906039..c35f54f181 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/ForegroundColorsConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/ForegroundColorsConfig.cs @@ -6,35 +6,66 @@ namespace AdaptiveCards.Rendering { + /// + /// Foreground Color Config + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class ForegroundColorsConfig { - + /// + /// Default Config + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public FontColorConfig Default { get; set; } = new FontColorConfig("#FF000000"); + /// + /// Accent config + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public FontColorConfig Accent { get; set; } = new FontColorConfig("#FF0000FF"); + /// + /// Dark config + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public FontColorConfig Dark { get; set; } = new FontColorConfig("#FF101010"); + /// + /// Light config + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public FontColorConfig Light { get; set; } = new FontColorConfig("#FFFFFFFF"); + /// + /// Good config + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public FontColorConfig Good { get; set; } = new FontColorConfig("#FF008000"); + /// + /// Warning config + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public FontColorConfig Warning { get; set; } = new FontColorConfig("#FFFFD700"); + /// + /// Attention config + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public FontColorConfig Attention { get; set; } = new FontColorConfig("#FF8B0000"); } + /// + /// Font Color config + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class FontColorConfig { + /// + /// Constructor + /// + /// + /// public FontColorConfig(string defaultColor, string subtle = null) { this.Default = defaultColor; @@ -58,9 +89,15 @@ public FontColorConfig(string defaultColor, string subtle = null) [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public string Default { get; set; } + /// + /// Subtle config + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public string Subtle { get; set; } + /// + /// HightlightColors config + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public HighlightColorConfig HighlightColors { get; set; } } diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/HeadingsConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/HeadingsConfig.cs index e7c98e3607..2cb9447068 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/HeadingsConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/HeadingsConfig.cs @@ -5,6 +5,9 @@ namespace AdaptiveCards.Rendering { + /// + /// Headings Config + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class HeadingsConfig { diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/HighlightColorConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/HighlightColorConfig.cs index 08491b1780..1c64255ab8 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/HighlightColorConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/HighlightColorConfig.cs @@ -6,9 +6,15 @@ namespace AdaptiveCards.Rendering { + /// + /// Configuration for HightlightColors + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class HighlightColorConfig { + /// + /// Constructor + /// public HighlightColorConfig() { this.Default = this.Subtle = "#FFFFFF00"; @@ -20,6 +26,9 @@ public HighlightColorConfig() [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public string Default { get; set; } + /// + /// Color config for subtle highlight + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public string Subtle { get; set; } } diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/ImageSetConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/ImageSetConfig.cs index 222c4aa536..e5dd3f5565 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/ImageSetConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/ImageSetConfig.cs @@ -6,11 +6,15 @@ namespace AdaptiveCards.Rendering { + /// + /// Config for ImageSets + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class ImageSetConfig { - public ImageSetConfig() { } - + /// + /// Define default image size for ImageSets. + /// public AdaptiveImageSize ImageSize { get; set; } = AdaptiveImageSize.Medium; } diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/ImageSizesConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/ImageSizesConfig.cs index 3e792c051f..731cecf695 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/ImageSizesConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/ImageSizesConfig.cs @@ -5,13 +5,25 @@ namespace AdaptiveCards.Rendering { + /// + /// Defines config for ImageSizes + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class ImageSizesConfig { + /// + /// Small image size config. + /// public int Small { get; set; } = 40; + /// + /// Medium image size config. + /// public int Medium { get; set; } = 80; + /// + /// Large image size config. + /// public int Large { get; set; } = 160; } } diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/InputsConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/InputsConfig.cs index 903aed41c8..c8d2a4ddac 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/InputsConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/InputsConfig.cs @@ -11,9 +11,16 @@ namespace AdaptiveCards.Rendering [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class InputsConfig { + + /// + /// LabelConfig config + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public LabelConfig Label { get; set; } = new LabelConfig(); + /// + /// ErrorMessage config + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public ErrorMessageConfig ErrorMessage { get; set; } = new ErrorMessageConfig(); } diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/LabelConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/LabelConfig.cs index cb6931e956..350bfdd4e5 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/LabelConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/LabelConfig.cs @@ -11,9 +11,15 @@ namespace AdaptiveCards.Rendering [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class LabelConfig { + /// + /// Required input label configs + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public InputLabelConfig RequiredInputs { get; set; } = new InputLabelConfig(); + /// + /// Optional input label configs + /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public InputLabelConfig OptionalInputs { get; set; } = new InputLabelConfig(); diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/RenderedAdaptiveCardBase.cs b/source/dotnet/Library/AdaptiveCards/Rendering/RenderedAdaptiveCardBase.cs index 3f48c5d9a9..606a6b533c 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/RenderedAdaptiveCardBase.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/RenderedAdaptiveCardBase.cs @@ -25,6 +25,12 @@ public abstract class RenderedAdaptiveCardBase /// public RenderedAdaptiveCardInputs UserInputs { get; set; } = new RenderedAdaptiveCardInputs(); + /// + /// Internal constructor + /// + /// + /// + /// protected RenderedAdaptiveCardBase(AdaptiveCard originatingCard, IList warnings) { Warnings = warnings ?? throw new ArgumentNullException(nameof(warnings)); diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/RenderedAdaptiveCardInputs.cs b/source/dotnet/Library/AdaptiveCards/Rendering/RenderedAdaptiveCardInputs.cs index da581fd387..c9794c8bd5 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/RenderedAdaptiveCardInputs.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/RenderedAdaptiveCardInputs.cs @@ -13,11 +13,18 @@ public class RenderedAdaptiveCardInputs { private readonly IDictionary> _inputBindings; + /// + /// Constructor + /// public RenderedAdaptiveCardInputs() { _inputBindings = new Dictionary>(); } + /// + /// Constructor with bindings. + /// + /// public RenderedAdaptiveCardInputs(ref IDictionary> inputBindings) { _inputBindings = inputBindings; diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/RendererUtilities.cs b/source/dotnet/Library/AdaptiveCards/Rendering/RendererUtilities.cs index c77973603f..285f79f77d 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/RendererUtilities.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/RendererUtilities.cs @@ -22,6 +22,11 @@ public static class RendererUtilities private static readonly Regex _regexBinding = new Regex(@"(?\{\{\w+?\}\})+?", RegexOptions.ExplicitCapture); + /// + /// Utility function for spacings. + /// + /// + /// public static string HandleHtmlSpaces(string text) { return text.Replace("&nbsp;", " ") @@ -33,6 +38,7 @@ public static string HandleHtmlSpaces(string text) /// This funct will return modified text replacing {{DATE|TIME()}} style functions as the formatted text /// /// + /// /// public static string ApplyTextFunctions(string text, string lang) { @@ -117,6 +123,13 @@ private enum TimeHints LONG } + /// + /// Joines strings choices together + /// + /// + /// + /// + /// public static string JoinString(List choices, string sep, string last) { if (choices == null || choices.Count == 0) @@ -136,6 +149,13 @@ public static string JoinString(List choices, string sep, string last) return sb.ToString(); } + /// + /// Typed lookup for anonymous dictionary. + /// + /// + /// + /// + /// public static T TryGetValue(this IDictionary dictionary, string key) { if (dictionary != null && dictionary.Contains(key)) @@ -146,6 +166,13 @@ public static T TryGetValue(this IDictionary dictionary, string key) return default(T); } + /// + /// Typed value lookup for anonymous dictionary. + /// + /// + /// + /// + /// public static T TryGetValue(this IDictionary dictionary, string key) { if (dictionary != null && dictionary.ContainsKey(key)) diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/SeparatorConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/SeparatorConfig.cs index fde5c518e0..128f00a2d7 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/SeparatorConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/SeparatorConfig.cs @@ -6,6 +6,9 @@ namespace AdaptiveCards.Rendering { + /// + /// Config for seperator + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class SeparatorConfig { diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/SpacingsConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/SpacingsConfig.cs index e842a3c990..448741a2be 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/SpacingsConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/SpacingsConfig.cs @@ -11,16 +11,34 @@ namespace AdaptiveCards.Rendering [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class SpacingsConfig { + /// + /// Small spacing config + /// public int Small { get; set; } = 3; + /// + /// Default spacing config + /// public int Default { get; set; } = 8; + /// + /// Medium spacing config + /// public int Medium { get; set; } = 20; + /// + /// Large spacing config + /// public int Large { get; set; } = 30; + /// + /// ExtraLarge spacing config + /// public int ExtraLarge { get; set; } = 40; + /// + /// Padding config + /// public int Padding { get; set; } = 15; } } diff --git a/source/dotnet/Library/AdaptiveCards/Rendering/TextBlockConfig.cs b/source/dotnet/Library/AdaptiveCards/Rendering/TextBlockConfig.cs index b9a2b80e14..a721712e2d 100644 --- a/source/dotnet/Library/AdaptiveCards/Rendering/TextBlockConfig.cs +++ b/source/dotnet/Library/AdaptiveCards/Rendering/TextBlockConfig.cs @@ -5,6 +5,9 @@ namespace AdaptiveCards.Rendering { + /// + /// Config for TextBlock + /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class TextBlockConfig { diff --git a/source/dotnet/Library/AdaptiveCards/SerializableDictionary.cs b/source/dotnet/Library/AdaptiveCards/SerializableDictionary.cs index c782f3236f..5dba8664c6 100644 --- a/source/dotnet/Library/AdaptiveCards/SerializableDictionary.cs +++ b/source/dotnet/Library/AdaptiveCards/SerializableDictionary.cs @@ -8,6 +8,7 @@ namespace AdaptiveCards { #if !NETSTANDARD1_3 +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member [XmlRoot("dictionary")] public class SerializableDictionary : Dictionary, IXmlSerializable { @@ -81,5 +82,6 @@ public void WriteXml(System.Xml.XmlWriter writer) } #endregion } +#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member #endif } diff --git a/source/dotnet/Library/AdaptiveCards/StrictIntConverter.cs b/source/dotnet/Library/AdaptiveCards/StrictIntConverter.cs index b78ef46c89..9b5ae5e68a 100644 --- a/source/dotnet/Library/AdaptiveCards/StrictIntConverter.cs +++ b/source/dotnet/Library/AdaptiveCards/StrictIntConverter.cs @@ -5,16 +5,21 @@ namespace AdaptiveCards { + /// + /// Converter for integers only. + /// public class StrictIntConverter : JsonConverter { readonly JsonSerializer defaultSerializer = new JsonSerializer(); + /// public override bool CanConvert(Type objectType) { // Only use this converter for Integer types return objectType.IsIntegerType(); } + /// public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { switch (reader.TokenType) @@ -28,8 +33,10 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist } } + /// public override bool CanWrite { get { return false; } } + /// public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { throw new NotImplementedException(); @@ -38,6 +45,11 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s public static partial class JsonExtensions { + /// + /// Helper function to determine if type is a integer type. + /// + /// + /// public static bool IsIntegerType(this Type type) { type = Nullable.GetUnderlyingType(type) ?? type; diff --git a/source/dotnet/Library/AdaptiveCards/ToggleElementsConverter.cs b/source/dotnet/Library/AdaptiveCards/ToggleElementsConverter.cs index 911a1b01e9..8dd8effa97 100644 --- a/source/dotnet/Library/AdaptiveCards/ToggleElementsConverter.cs +++ b/source/dotnet/Library/AdaptiveCards/ToggleElementsConverter.cs @@ -11,14 +11,19 @@ namespace AdaptiveCards { + /// + /// Converter for AdaptiveTargetElement + /// public class ToggleElementsConverter : JsonConverter { + /// public override bool CanConvert(Type objectType) { return typeof(List).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); } + /// public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { var array = JArray.Load(reader); @@ -40,6 +45,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist return arrayList; } + /// public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { List targetElements = (List)value; diff --git a/source/dotnet/Library/AdaptiveCards/TypedEventHandler.cs b/source/dotnet/Library/AdaptiveCards/TypedEventHandler.cs index c641219f60..40da5bec01 100644 --- a/source/dotnet/Library/AdaptiveCards/TypedEventHandler.cs +++ b/source/dotnet/Library/AdaptiveCards/TypedEventHandler.cs @@ -4,6 +4,13 @@ namespace AdaptiveCards { + /// + /// Delegate for typed events + /// + /// + /// + /// + /// public delegate void TypedEventHandler( TSender sender, TEventArgs e diff --git a/source/dotnet/Library/AdaptiveCards/WarningLoggingContractResolver.cs b/source/dotnet/Library/AdaptiveCards/WarningLoggingContractResolver.cs index 1eda59fa2a..b07ce5f113 100644 --- a/source/dotnet/Library/AdaptiveCards/WarningLoggingContractResolver.cs +++ b/source/dotnet/Library/AdaptiveCards/WarningLoggingContractResolver.cs @@ -58,10 +58,12 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ converterWithContext.ParseContext = _parseContext; } +#pragma warning disable CS0618 // Type or member is obsolete if (property?.MemberConverter is ILogWarnings memberConverter) { memberConverter.Warnings = _parseResult.Warnings; } +#pragma warning restore CS0618 // Type or member is obsolete return property; } diff --git a/source/dotnet/Samples/AdaptiveCards.Sample.ImageRender/AdaptiveCards.Sample.ImageRender.csproj b/source/dotnet/Samples/AdaptiveCards.Sample.ImageRender/AdaptiveCards.Sample.ImageRender.csproj index 2497853c81..18bf2b8666 100644 --- a/source/dotnet/Samples/AdaptiveCards.Sample.ImageRender/AdaptiveCards.Sample.ImageRender.csproj +++ b/source/dotnet/Samples/AdaptiveCards.Sample.ImageRender/AdaptiveCards.Sample.ImageRender.csproj @@ -2,14 +2,14 @@ Exe - net4.5.2 + net462 false - + diff --git a/source/dotnet/Samples/ImageRendererServer/ImageRendererServer.csproj b/source/dotnet/Samples/ImageRendererServer/ImageRendererServer.csproj index 21d86ba855..a1e54fed0c 100644 --- a/source/dotnet/Samples/ImageRendererServer/ImageRendererServer.csproj +++ b/source/dotnet/Samples/ImageRendererServer/ImageRendererServer.csproj @@ -1,7 +1,7 @@ - net461 + net462 false diff --git a/source/dotnet/Samples/WPFVisualizer/AdaptiveCards.Sample.WPFVisualizer.csproj b/source/dotnet/Samples/WPFVisualizer/AdaptiveCards.Sample.WPFVisualizer.csproj index adccb90305..32dceed1fe 100644 --- a/source/dotnet/Samples/WPFVisualizer/AdaptiveCards.Sample.WPFVisualizer.csproj +++ b/source/dotnet/Samples/WPFVisualizer/AdaptiveCards.Sample.WPFVisualizer.csproj @@ -46,6 +46,7 @@ 4 true CurrentArchitecture + NU1701 CurrentArchitecture @@ -185,16 +186,16 @@ - 6.0.1 + 6.3.0.90 - 4.0.1 + 4.6.0 13.0.3 - 5.7.0 + 6.9.1 runtime; build; native; contentfiles; analyzers all diff --git a/source/dotnet/Test/AdaptiveCards.Templating.Test/AdaptiveCards.Templating.Test.csproj b/source/dotnet/Test/AdaptiveCards.Templating.Test/AdaptiveCards.Templating.Test.csproj index 13a860a3d4..8e796f6615 100644 --- a/source/dotnet/Test/AdaptiveCards.Templating.Test/AdaptiveCards.Templating.Test.csproj +++ b/source/dotnet/Test/AdaptiveCards.Templating.Test/AdaptiveCards.Templating.Test.csproj @@ -7,13 +7,16 @@ - - - - - - - + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/source/dotnet/Test/AdaptiveCards.Templating.Test/TestTransform.cs b/source/dotnet/Test/AdaptiveCards.Templating.Test/TestTransform.cs index 99bc15b7c7..aab1b606b2 100644 --- a/source/dotnet/Test/AdaptiveCards.Templating.Test/TestTransform.cs +++ b/source/dotnet/Test/AdaptiveCards.Templating.Test/TestTransform.cs @@ -11446,7 +11446,7 @@ public void TestSortFunctionInDataCreateAnArray() { string cardJson = transformer.Expand(context); } - catch (AdaptiveTemplateException e) + catch (AdaptiveTemplateException) { Assert.Fail("No exception should be thrown"); } diff --git a/source/dotnet/Test/AdaptiveCards.Test/AdaptiveActionTests.cs b/source/dotnet/Test/AdaptiveCards.Test/AdaptiveActionTests.cs index 3d3f9fb172..1afaee30c4 100644 --- a/source/dotnet/Test/AdaptiveCards.Test/AdaptiveActionTests.cs +++ b/source/dotnet/Test/AdaptiveCards.Test/AdaptiveActionTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; using System.Collections.Generic; namespace AdaptiveCards.Test @@ -60,7 +61,7 @@ public void ParseInvalidAction() Assert.IsTrue(result.Warnings.Count == 1); AdaptiveImage image = (AdaptiveImage) card.Body[0]; - Assert.AreEqual(image.Url, url); + Assert.AreEqual(image.Url, new Uri(url)); Assert.IsNull(image.SelectAction); } diff --git a/source/dotnet/Test/AdaptiveCards.Test/AdaptiveCards.Test.csproj b/source/dotnet/Test/AdaptiveCards.Test/AdaptiveCards.Test.csproj index 5acf5db1fa..3735635357 100644 --- a/source/dotnet/Test/AdaptiveCards.Test/AdaptiveCards.Test.csproj +++ b/source/dotnet/Test/AdaptiveCards.Test/AdaptiveCards.Test.csproj @@ -7,12 +7,12 @@ - - - - + + + + - + From aa29191eaabe46e218fdb73d814298e3b26c9547 Mon Sep 17 00:00:00 2001 From: Tom Laird-McConnell Date: Mon, 6 May 2024 15:42:22 -0700 Subject: [PATCH 2/5] removed all #ifdef STANDARD1_3 directives as they are meaningless with netstandard2.0 --- .../Library/AdaptiveCards/AdaptiveAction.cs | 12 ------ .../AdaptiveCards/AdaptiveActionSet.cs | 6 --- .../AdaptiveCards/AdaptiveAuthCardButton.cs | 8 ---- .../AdaptiveCards/AdaptiveAuthentication.cs | 8 ---- .../AdaptiveCards/AdaptiveBackgroundImage.cs | 12 ------ .../AdaptiveCards/AdaptiveCaptionSource.cs | 8 ---- .../Library/AdaptiveCards/AdaptiveCard.cs | 41 ------------------- .../Library/AdaptiveCards/AdaptiveChoice.cs | 6 --- .../AdaptiveCards/AdaptiveChoiceSetInput.cs | 16 -------- .../AdaptiveCollectionElement.cs | 17 +------- .../AdaptiveCollectionWithContentAlignment.cs | 4 -- .../Library/AdaptiveCards/AdaptiveColumn.cs | 6 --- .../AdaptiveCards/AdaptiveColumnSet.cs | 6 --- .../AdaptiveCards/AdaptiveContainer.cs | 12 ------ .../AdaptiveCards/AdaptiveDataQuery.cs | 12 ------ .../AdaptiveCards/AdaptiveDateInput.cs | 12 ------ .../Library/AdaptiveCards/AdaptiveElement.cs | 8 ---- .../AdaptiveCards/AdaptiveExecuteAction.cs | 12 ------ .../Library/AdaptiveCards/AdaptiveFact.cs | 6 --- .../Library/AdaptiveCards/AdaptiveFactSet.cs | 6 --- .../Library/AdaptiveCards/AdaptiveHeight.cs | 6 --- .../Library/AdaptiveCards/AdaptiveImage.cs | 24 ----------- .../Library/AdaptiveCards/AdaptiveImageSet.cs | 8 ---- .../Library/AdaptiveCards/AdaptiveInline.cs | 2 - .../Library/AdaptiveCards/AdaptiveInput.cs | 6 --- .../Library/AdaptiveCards/AdaptiveMedia.cs | 12 ------ .../AdaptiveCards/AdaptiveMediaSource.cs | 6 --- .../Library/AdaptiveCards/AdaptiveMetadata.cs | 2 - .../AdaptiveCards/AdaptiveNumberInput.cs | 12 ------ .../AdaptiveCards/AdaptiveOpenUrlAction.cs | 8 ---- .../Library/AdaptiveCards/AdaptiveRefresh.cs | 10 ----- .../AdaptiveCards/AdaptiveRichTextBlock.cs | 8 ---- .../AdaptiveCards/AdaptiveSchemaVersion.cs | 4 -- .../AdaptiveCards/AdaptiveShowCardAction.cs | 6 --- .../AdaptiveCards/AdaptiveSubmitAction.cs | 10 ----- .../Library/AdaptiveCards/AdaptiveTable.cs | 14 ------- .../AdaptiveCards/AdaptiveTableCell.cs | 10 ----- .../AdaptiveTableColumnDefinition.cs | 8 ---- .../Library/AdaptiveCards/AdaptiveTableRow.cs | 10 ----- .../AdaptiveCards/AdaptiveTargetElement.cs | 6 --- .../AdaptiveCards/AdaptiveTextBlock.cs | 30 -------------- .../AdaptiveCards/AdaptiveTextInput.cs | 18 -------- .../Library/AdaptiveCards/AdaptiveTextRun.cs | 24 ----------- .../AdaptiveCards/AdaptiveTimeInput.cs | 12 ------ .../AdaptiveCards/AdaptiveToggleInput.cs | 14 ------- .../AdaptiveToggleVisibilityAction.cs | 6 --- .../AdaptiveTokenExchangeResource.cs | 6 --- .../AdaptiveCards/AdaptiveTypedElement.cs | 10 ----- .../Library/AdaptiveCards/AdaptiveWidth.cs | 6 --- .../AdaptiveCards/SerializableDictionary.cs | 2 - .../Properties/Resources.Designer.cs | 2 +- 51 files changed, 2 insertions(+), 518 deletions(-) diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveAction.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveAction.cs index d530280781..20cd1da5bd 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveAction.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveAction.cs @@ -17,9 +17,7 @@ public abstract class AdaptiveAction : AdaptiveTypedElement /// Title of the action /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Title { get; set; } /// @@ -33,18 +31,14 @@ public abstract class AdaptiveAction : AdaptiveTypedElement /// IconUrl that can be specified for actions /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string IconUrl { get; set; } /// /// Style that can be specified for actions /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue("default")] public string Style { get; set; } = "default"; @@ -52,9 +46,7 @@ public abstract class AdaptiveAction : AdaptiveTypedElement /// When set false, action is disabled /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(true)] public bool IsEnabled{ get; set; } = true; @@ -62,9 +54,7 @@ public abstract class AdaptiveAction : AdaptiveTypedElement /// Determines whether the action should be displayed as a button or in the overflow menu. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveActionMode), "primary")] public AdaptiveActionMode Mode { get; set; } @@ -72,9 +62,7 @@ public abstract class AdaptiveAction : AdaptiveTypedElement /// Defines text that should be displayed to the end user as they hover the mouse over the action, and read when using narration software. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Tooltip{ get; set; } } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveActionSet.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveActionSet.cs index c848cbb3b5..d743cc4348 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveActionSet.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveActionSet.cs @@ -13,9 +13,7 @@ namespace AdaptiveCards /// /// Represents the ActionSet element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveActionSet.TypeName)] -#endif public class AdaptiveActionSet : AdaptiveElement { /// @@ -26,9 +24,7 @@ public class AdaptiveActionSet : AdaptiveElement /// /// The JSON property name that this class implements. /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [JsonProperty(Required = Required.Default)] public override string Type { get; set; } = TypeName; @@ -36,14 +32,12 @@ public class AdaptiveActionSet : AdaptiveElement /// The actions contained within this ActionSet. /// [JsonConverter(typeof(IgnoreEmptyItemsConverter))] -#if !NETSTANDARD1_3 [XmlElement(typeof(AdaptiveOpenUrlAction))] [XmlElement(typeof(AdaptiveShowCardAction))] [XmlElement(typeof(AdaptiveSubmitAction))] [XmlElement(typeof(AdaptiveToggleVisibilityAction))] [XmlElement(typeof(AdaptiveExecuteAction))] [XmlElement(typeof(AdaptiveUnknownAction))] -#endif public List Actions { get; set; } = new List(); } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveAuthCardButton.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveAuthCardButton.cs index bf021055b8..017781f055 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveAuthCardButton.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveAuthCardButton.cs @@ -14,36 +14,28 @@ public class AdaptiveAuthCardButton /// The type of the button. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Type { get; set; } /// /// The caption of the button. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Title { get; set; } /// /// A URL to an image to display alongside the button's caption. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Image { get; set; } /// /// The value associated with the button. The meaning of value depends on the button's type. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Value { get; set; } } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveAuthentication.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveAuthentication.cs index 5b5c97af5c..2572e7b39b 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveAuthentication.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveAuthentication.cs @@ -15,36 +15,28 @@ public class AdaptiveAuthentication /// Text that can be displayed to the end user when prompting them to authenticate. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Text { get; set; } /// /// The identifier for registered OAuth connection setting information. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string ConnectionName { get; set; } /// /// Provides information required to enable on-behalf-of single sign-on user authentication. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlElement(typeof(AdaptiveTokenExchangeResource))] -#endif public AdaptiveTokenExchangeResource TokenExchangeResource { get; set; } /// /// Buttons that should be displayed to the user when prompting for authentication. The array MUST contain one button of type \"signin\". Other button types are not currently supported. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlElement(typeof(AdaptiveAuthCardButton))] -#endif public List Buttons { get; set; } = new List(); } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveBackgroundImage.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveBackgroundImage.cs index af536abdb4..416d8af4fd 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveBackgroundImage.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveBackgroundImage.cs @@ -11,9 +11,7 @@ namespace AdaptiveCards /// /// Represents the backgroundImage property /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveBackgroundImage.TypeName)] -#endif [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class AdaptiveBackgroundImage { @@ -79,19 +77,15 @@ public AdaptiveBackgroundImage(Uri url, AdaptiveImageFillMode fillMode, Adaptive /// The Url of the background image. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [DefaultValue(null)] public Uri Url { get; set; } /// /// The Url of the background image as a string. /// -#if !NETSTANDARD1_3 [XmlAttribute("BackgroundImage")] [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] -#endif [JsonIgnore] public string UrlString { @@ -103,9 +97,7 @@ public string UrlString /// Controls how the image is tiled or stretched. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveImageFillMode), "cover")] public AdaptiveImageFillMode FillMode { get; set; } @@ -113,9 +105,7 @@ public string UrlString /// Determines how to align the background image horizontally. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveHorizontalAlignment), "left")] public AdaptiveHorizontalAlignment HorizontalAlignment { get; set; } @@ -123,9 +113,7 @@ public string UrlString /// Determines how to align the background image vertically. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveVerticalAlignment), "top")] public AdaptiveVerticalAlignment VerticalAlignment { get; set; } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveCaptionSource.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveCaptionSource.cs index c7bb8a7b7e..3b35dc4907 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveCaptionSource.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveCaptionSource.cs @@ -10,9 +10,7 @@ namespace AdaptiveCards /// Represents a "media source" for a Media element. /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] -#if !NETSTANDARD1_3 [XmlType(TypeName = "CaptionSource")] -#endif public class AdaptiveCaptionSource { /// @@ -37,27 +35,21 @@ public AdaptiveCaptionSource(string mimeType, string url) /// The mime type of this media source. /// [JsonProperty] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string MimeType { get; set; } /// /// The URL of this media source. /// [JsonProperty] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Url { get; set; } /// /// The caption label for the caption /// [JsonProperty] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Label { get; set; } } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveCard.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveCard.cs index a31ffc7033..216dd63038 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveCard.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveCard.cs @@ -14,9 +14,7 @@ namespace AdaptiveCards /// Adaptive card which has flexible container /// [JsonConverter(typeof(AdaptiveCardConverter))] -#if !NETSTANDARD1_3 [XmlRoot(ElementName = "Card")] -#endif public class AdaptiveCard : AdaptiveTypedElement { /// @@ -30,9 +28,7 @@ public class AdaptiveCard : AdaptiveTypedElement public const string TypeName = "AdaptiveCard"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// @@ -64,9 +60,7 @@ public AdaptiveCard() : this(new AdaptiveSchemaVersion(1, 0)) { } /// Schema version that this card requires. If a client is lower than this version the fallbackText will be rendered. /// [JsonProperty(Order = -10, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, NullValueHandling = NullValueHandling.Include)] -#if !NETSTANDARD1_3 [XmlElement] -#endif [DefaultValue(null)] public AdaptiveSchemaVersion Version { get; set; } @@ -81,9 +75,7 @@ public AdaptiveCard() : this(new AdaptiveSchemaVersion(1, 0)) { } /// Text shown when the client doesn’t support the version specified. This can be in markdown format. /// [JsonProperty(Order = -8, NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string FallbackText { get; set; } @@ -91,9 +83,7 @@ public AdaptiveCard() : this(new AdaptiveSchemaVersion(1, 0)) { } /// Speak annotation for the card. /// [JsonProperty(Order = -7, NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlElement] -#endif [DefaultValue(null)] public string Speak { get; set; } @@ -101,9 +91,7 @@ public AdaptiveCard() : this(new AdaptiveSchemaVersion(1, 0)) { } /// The 2-letter ISO-639-1 language used in the card. Used to localize any date/time functions. /// [JsonProperty(Order = -7, NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Lang { get; set; } @@ -117,9 +105,7 @@ public AdaptiveCard() : this(new AdaptiveSchemaVersion(1, 0)) { } /// /// Background image for card. /// -#if !NETSTANDARD1_3 [XmlElement] -#endif [JsonProperty(Order = -5, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] [JsonConverter(typeof(AdaptiveBackgroundImageConverter))] [DefaultValue(null)] @@ -130,18 +116,14 @@ public AdaptiveCard() : this(new AdaptiveSchemaVersion(1, 0)) { } /// [JsonConverter(typeof(AdaptiveHeightConverter))] [JsonProperty(Order = -4, DefaultValueHandling = DefaultValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlElement] -#endif public AdaptiveHeight Height { get; set; } = new AdaptiveHeight(AdaptiveHeightType.Auto); /// /// Explicit card minimum height with 'px'. (100px, 200px) /// [JsonProperty("minHeight", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string MinHeight { get; set; } @@ -149,9 +131,7 @@ public AdaptiveCard() : this(new AdaptiveSchemaVersion(1, 0)) { } /// PixelMinHeight if height is not auto/stretch /// [JsonIgnore] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public uint PixelMinHeight { get => uint.TryParse(MinHeight?.Replace("px", ""), out var val) ? (uint)val : 0; set => MinHeight = $"{value}px"; } /// @@ -159,7 +139,6 @@ public AdaptiveCard() : this(new AdaptiveSchemaVersion(1, 0)) { } /// [JsonProperty(Order = -3)] [JsonConverter(typeof(IgnoreEmptyItemsConverter))] -#if !NETSTANDARD1_3 [XmlElement(typeof(AdaptiveTextBlock))] [XmlElement(typeof(AdaptiveRichTextBlock))] [XmlElement(typeof(AdaptiveImage))] @@ -177,7 +156,6 @@ public AdaptiveCard() : this(new AdaptiveSchemaVersion(1, 0)) { } [XmlElement(typeof(AdaptiveActionSet))] [XmlElement(typeof(AdaptiveTable))] [XmlElement(typeof(AdaptiveUnknownElement))] -#endif public List Body { get; set; } = new List(); /// @@ -190,13 +168,10 @@ public AdaptiveCard() : this(new AdaptiveSchemaVersion(1, 0)) { } /// Sets the text flow direction /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [DefaultValue(null)] public bool? Rtl { get; set; } = null; -#if !NETSTANDARD1_3 /// /// Controls XML serialization of style. /// @@ -210,22 +185,18 @@ public AdaptiveCard() : this(new AdaptiveSchemaVersion(1, 0)) { } /// Determines whether to serialize the style for XML. /// public bool ShouldSerializeRtlXml() => this.Rtl.HasValue; -#endif - /// /// The Actions for this card. /// [JsonProperty(Order = -2)] [JsonConverter(typeof(IgnoreEmptyItemsConverter))] -#if !NETSTANDARD1_3 [XmlElement(typeof(AdaptiveOpenUrlAction))] [XmlElement(typeof(AdaptiveShowCardAction))] [XmlElement(typeof(AdaptiveSubmitAction))] [XmlElement(typeof(AdaptiveToggleVisibilityAction))] [XmlElement(typeof(AdaptiveExecuteAction))] [XmlElement(typeof(AdaptiveUnknownAction))] -#endif public List Actions { get; set; } = new List(); /// @@ -238,9 +209,7 @@ public AdaptiveCard() : this(new AdaptiveSchemaVersion(1, 0)) { } /// This makes sure the $schema property doesn't show up in AdditionalProperties /// [JsonProperty("$schema")] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif internal string JsonSchema { get; set; } /// @@ -256,9 +225,7 @@ public bool ShouldSerializeJsonSchema() /// The content alignment for the element inside the container. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlElement] -#endif [DefaultValue(typeof(AdaptiveVerticalContentAlignment), "top")] public AdaptiveVerticalContentAlignment VerticalContentAlignment { get; set; } @@ -266,9 +233,7 @@ public bool ShouldSerializeJsonSchema() /// Action for the card (this allows a default action at the card level) /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlElement] -#endif [DefaultValue(null)] public AdaptiveAction SelectAction { get; set; } @@ -276,9 +241,7 @@ public bool ShouldSerializeJsonSchema() /// Defines how the card can be refreshed by making a request to the target Bot. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlElement] -#endif [DefaultValue(null)] public AdaptiveRefresh Refresh { get; set; } @@ -286,9 +249,7 @@ public bool ShouldSerializeJsonSchema() /// Defines authentication information to enable on-behalf-of single sign on or just-in-time OAuth. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlElement] -#endif [DefaultValue(null)] public AdaptiveAuthentication Authentication { get; set; } @@ -296,9 +257,7 @@ public bool ShouldSerializeJsonSchema() /// Defines various metadata properties typically not used for rendering the card /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlElement] -#endif [DefaultValue(null)] public AdaptiveMetadata Metadata { get; set; } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveChoice.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveChoice.cs index ac03656148..14f0cda309 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveChoice.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveChoice.cs @@ -12,18 +12,14 @@ namespace AdaptiveCards /// Choice as part of a Input.AdaptiveChoiceSetInput element /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] -#if !NETSTANDARD1_3 [XmlType(TypeName = "Choice")] -#endif public class AdaptiveChoice { /// /// Display text for the choice /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Title { get; set; } @@ -31,9 +27,7 @@ public class AdaptiveChoice /// Internal value which will be collected as input if the choice is selected /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Value { get; set; } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveChoiceSetInput.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveChoiceSetInput.cs index 6cda615a30..fb0b2e7e1a 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveChoiceSetInput.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveChoiceSetInput.cs @@ -13,9 +13,7 @@ namespace AdaptiveCards /// /// Represents the Input.ChoiceSet element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveChoiceSetInput.TypeName)] -#endif public class AdaptiveChoiceSetInput : AdaptiveInput { /// @@ -24,18 +22,14 @@ public class AdaptiveChoiceSetInput : AdaptiveInput public const string TypeName = "Input.ChoiceSet"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// /// Comma separated string of selected Choice values. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Value { get; set; } @@ -43,9 +37,7 @@ public class AdaptiveChoiceSetInput : AdaptiveInput /// The style to use when displaying this Input.ChoiceSet. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveChoiceInputStyle), "compact")] public AdaptiveChoiceInputStyle Style { get; set; } @@ -53,9 +45,7 @@ public class AdaptiveChoiceSetInput : AdaptiveInput /// Determines whether multiple selections are allowed. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool IsMultiSelect { get; set; } @@ -69,9 +59,7 @@ public class AdaptiveChoiceSetInput : AdaptiveInput /// Controls text wrapping behavior. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool Wrap { get; set; } @@ -79,9 +67,7 @@ public class AdaptiveChoiceSetInput : AdaptiveInput /// Text to display as a placeholder. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Placeholder { get; set; } @@ -90,9 +76,7 @@ public class AdaptiveChoiceSetInput : AdaptiveInput /// [JsonProperty("choices.data", NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlElement(typeof(AdaptiveDataQuery), ElementName = "Data.Query")] -#endif [DefaultValue(null)] public AdaptiveDataQuery DataQuery { get; set; } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveCollectionElement.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveCollectionElement.cs index a37f48c075..b472e156b6 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveCollectionElement.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveCollectionElement.cs @@ -19,13 +19,10 @@ public abstract class AdaptiveCollectionElement : AdaptiveElement, IEnumerable [JsonConverter(typeof(IgnoreNullEnumConverter), true)] [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [DefaultValue(null)] public AdaptiveContainerStyle? Style { get; set; } -#if !NETSTANDARD1_3 /// /// Controls XML serialization of style. /// @@ -39,7 +36,7 @@ public abstract class AdaptiveCollectionElement : AdaptiveElement, IEnumerable public bool ShouldSerializeStyleXml() => this.Style.HasValue; -#endif + /// public abstract IEnumerator GetEnumerator(); @@ -57,9 +54,7 @@ IEnumerator IEnumerable.GetEnumerator() /// Horizontal alignment for element. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveHorizontalAlignment), "left")] public AdaptiveHorizontalAlignment HorizontalAlignment { get; set; } @@ -67,9 +62,7 @@ IEnumerator IEnumerable.GetEnumerator() /// The content alignment for the element inside the container. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveVerticalContentAlignment), "top")] public AdaptiveVerticalContentAlignment VerticalContentAlignment { get; set; } @@ -77,9 +70,7 @@ IEnumerator IEnumerable.GetEnumerator() /// Action for this container. This allows for setting a default action at the container level. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlElement] -#endif [DefaultValue(null)] public AdaptiveAction SelectAction { get; set; } @@ -87,9 +78,7 @@ IEnumerator IEnumerable.GetEnumerator() /// Defines if the element can bleed through its parent's padding. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool Bleed { get; set; } @@ -97,9 +86,7 @@ IEnumerator IEnumerable.GetEnumerator() /// Explicit card minimum height with 'px'. (100px, 200px) /// [JsonProperty("minHeight", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string MinHeight { get; set; } @@ -107,9 +94,7 @@ IEnumerator IEnumerable.GetEnumerator() /// Explicit container element minimum height. /// [JsonIgnore] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public uint PixelMinHeight { get => uint.TryParse(MinHeight?.Replace("px", ""), out var val) ? (uint)val : 0; set => MinHeight = $"{value}px"; } } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveCollectionWithContentAlignment.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveCollectionWithContentAlignment.cs index 04be66acb5..724094e57b 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveCollectionWithContentAlignment.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveCollectionWithContentAlignment.cs @@ -21,9 +21,7 @@ public abstract class AdaptiveCollectionWithContentAlignment : AdaptiveCollectio /// The content alignment for the TableCells inside the TableRow. /// [JsonProperty("verticalCellContentAlignment", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveVerticalContentAlignment), "top")] public AdaptiveVerticalContentAlignment VerticalCellContentAlignment { get; set; } @@ -31,9 +29,7 @@ public abstract class AdaptiveCollectionWithContentAlignment : AdaptiveCollectio /// The content alignment for the TableCells inside the TableRow. /// [JsonProperty("horizontalCellContentAlignment", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveHorizontalContentAlignment), "left")] public AdaptiveHorizontalContentAlignment HorizontalCellContentAlignment { get; set; } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveColumn.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveColumn.cs index 7ab775ae34..1a2fd26592 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveColumn.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveColumn.cs @@ -11,18 +11,14 @@ namespace AdaptiveCards /// /// Represents the Column element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveColumn.TypeName)] -#endif public class AdaptiveColumn : AdaptiveContainer { /// public new const string TypeName = "Column"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [JsonProperty(Required = Required.Default)] public override string Type { get; set; } = TypeName; @@ -38,9 +34,7 @@ public class AdaptiveColumn : AdaptiveContainer /// [JsonConverter(typeof(AdaptiveWidthConverter))] [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public AdaptiveWidth Width { get; set; } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveColumnSet.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveColumnSet.cs index 3f0b81528b..53b4637768 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveColumnSet.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveColumnSet.cs @@ -10,27 +10,21 @@ namespace AdaptiveCards /// /// Represents the ColumnSet element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveColumnSet.TypeName)] -#endif public class AdaptiveColumnSet : AdaptiveCollectionElement { /// public const string TypeName = "ColumnSet"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// /// Collection of Columns that this ColumnSet contains. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlElement(Type = typeof(AdaptiveColumn), ElementName = AdaptiveColumn.TypeName)] -#endif public List Columns { get; set; } = new List(); /// diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveContainer.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveContainer.cs index f676d29254..2be1229e5b 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveContainer.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveContainer.cs @@ -11,18 +11,14 @@ namespace AdaptiveCards /// /// Represents the Container element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveContainer.TypeName)] -#endif public class AdaptiveContainer : AdaptiveCollectionElement { /// public const string TypeName = "Container"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// @@ -31,9 +27,7 @@ public class AdaptiveContainer : AdaptiveCollectionElement [JsonConverter(typeof(AdaptiveBackgroundImageConverter))] [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] [DefaultValue(null)] -#if !NETSTANDARD1_3 [XmlElement(nameof(BackgroundImage))] -#endif public AdaptiveBackgroundImage BackgroundImage { get; set; } /// @@ -41,7 +35,6 @@ public class AdaptiveContainer : AdaptiveCollectionElement /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] [JsonConverter(typeof(IgnoreEmptyItemsConverter))] -#if !NETSTANDARD1_3 [XmlElement(typeof(AdaptiveTextBlock))] [XmlElement(typeof(AdaptiveRichTextBlock))] [XmlElement(typeof(AdaptiveImage))] @@ -59,20 +52,16 @@ public class AdaptiveContainer : AdaptiveCollectionElement [XmlElement(typeof(AdaptiveActionSet))] [XmlElement(typeof(AdaptiveTable))] [XmlElement(typeof(AdaptiveUnknownElement))] -#endif public List Items { get; set; } = new List(); /// /// Sets the text flow direction /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [DefaultValue(null)] public bool? Rtl { get; set; } = null; -#if !NETSTANDARD1_3 /// /// Controls XML serialization of style. /// @@ -86,7 +75,6 @@ public class AdaptiveContainer : AdaptiveCollectionElement /// Determines whether to serialize the style for XML. /// public bool ShouldSerializeRtlXml() => this.Rtl.HasValue; -#endif /// public override IEnumerator GetEnumerator() diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveDataQuery.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveDataQuery.cs index 3f082c1bf1..42a9e866fc 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveDataQuery.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveDataQuery.cs @@ -10,9 +10,7 @@ namespace AdaptiveCards /// Data.Query data structure for filtered choicesets. /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] -#if !NETSTANDARD1_3 [XmlType("Data.Query")] -#endif public class AdaptiveDataQuery { /// @@ -25,45 +23,35 @@ public class AdaptiveDataQuery /// Specifies that it's a Data.Query object. /// [JsonProperty] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public string Type { get; set; } = "Data.Query"; /// /// Specifies the name of dataset that is fetched dynamically. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Dataset { get; set; } /// /// Populates the input /// [JsonProperty] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Value { get; set; } /// /// Populates the suggested page size or number of items to request /// [JsonProperty] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public int Count { get; set; } /// /// Populates the skip value for paging /// [JsonProperty] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public int Skip { get; set; } } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveDateInput.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveDateInput.cs index 2b0e6a112c..832c032694 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveDateInput.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveDateInput.cs @@ -9,27 +9,21 @@ namespace AdaptiveCards /// /// Represents the Input.Date element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveDateInput.TypeName)] -#endif public class AdaptiveDateInput : AdaptiveInput { /// public const string TypeName = "Input.Date"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// /// Placeholder text to display. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Placeholder { get; set; } @@ -37,9 +31,7 @@ public class AdaptiveDateInput : AdaptiveInput /// The initial value for the field. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Value { get; set; } @@ -47,9 +39,7 @@ public class AdaptiveDateInput : AdaptiveInput /// Hint of minimum value (note: may be ignored by some clients). /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Min { get; set; } @@ -57,9 +47,7 @@ public class AdaptiveDateInput : AdaptiveInput /// Hint of maximum value (note: may be ignored by some clients). /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Max { get; set; } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveElement.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveElement.cs index e2f4d589cd..54fbc27edd 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveElement.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveElement.cs @@ -16,9 +16,7 @@ public abstract class AdaptiveElement : AdaptiveTypedElement /// The amount of space the element should be separated from the previous element. Default value is . /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveSpacing), "default")] public AdaptiveSpacing Spacing { get; set; } @@ -26,9 +24,7 @@ public abstract class AdaptiveElement : AdaptiveTypedElement /// Indicates whether there should be a visible separator (e.g. a line) between this element and the one before it. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool Separator { get; set; } @@ -44,9 +40,7 @@ public abstract class AdaptiveElement : AdaptiveTypedElement /// [JsonConverter(typeof(AdaptiveHeightConverter))] [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlElement] -#endif public AdaptiveHeight Height { get; set; } = new AdaptiveHeight(AdaptiveHeightType.Auto); /// @@ -58,9 +52,7 @@ public abstract class AdaptiveElement : AdaptiveTypedElement /// Indicates whether the element should be visible when the card has been rendered. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlElement] -#endif [DefaultValue(true)] public bool IsVisible { get; set; } = true; } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveExecuteAction.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveExecuteAction.cs index 0309b438e5..d0352374d2 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveExecuteAction.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveExecuteAction.cs @@ -10,18 +10,14 @@ namespace AdaptiveCards /// Execute action gathers up input fields, merges with optional data field and generates event to client /// asking for data to be submitted. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveExecuteAction.TypeName)] -#endif public class AdaptiveExecuteAction : AdaptiveAction { /// public const string TypeName = "Action.Execute"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// @@ -29,18 +25,14 @@ public class AdaptiveExecuteAction : AdaptiveAction /// {"id":"123123123"} /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public object Data { get; set; } /// /// Controls which inputs are associated with the execute action /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveAssociatedInputs), "auto")] public AdaptiveAssociatedInputs AssociatedInputs { get; set; } @@ -49,18 +41,14 @@ public class AdaptiveExecuteAction : AdaptiveAction /// The card author-defined verb associated with this action. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Verb { get; set; } = ""; /// /// Get or set the data as a JSON string. /// [JsonIgnore] -#if !NETSTANDARD1_3 [XmlText] -#endif public string DataJson { get diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveFact.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveFact.cs index 7be8417d16..1e563028ae 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveFact.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveFact.cs @@ -12,9 +12,7 @@ namespace AdaptiveCards /// Represents a "fact" in a FactSet element. /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] -#if !NETSTANDARD1_3 [XmlType(TypeName = "Fact")] -#endif public class AdaptiveFact { /// @@ -38,18 +36,14 @@ public AdaptiveFact(string title, string value) /// The Fact's title. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Title { get; set; } /// /// The Fact's value. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Value { get; set; } /// diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveFactSet.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveFactSet.cs index 37bd5e96f4..7bef23c85d 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveFactSet.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveFactSet.cs @@ -9,27 +9,21 @@ namespace AdaptiveCards /// /// Represents the FactSet element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveFactSet.TypeName)] -#endif public class AdaptiveFactSet : AdaptiveElement { /// public const string TypeName = "FactSet"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// /// A collection of Facts to this FactSet contains. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlElement(Type = typeof(AdaptiveFact), ElementName = "Fact")] -#endif public List Facts { get; set; } = new List(); } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveHeight.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveHeight.cs index d08deef81d..4275289117 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveHeight.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveHeight.cs @@ -114,21 +114,16 @@ public AdaptiveHeight(AdaptiveHeightType heightType) /// The this instance represents. /// [JsonProperty("heightType")] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public AdaptiveHeightType HeightType { get; set; } /// /// The specific height to use (only valid for the type). /// [JsonProperty("unit")] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public uint? Unit { get; set; } -#if !NETSTANDARD1_3 /// /// Helper to aid in XML serialization of the property. /// @@ -140,7 +135,6 @@ public AdaptiveHeight(AdaptiveHeightType heightType) /// Determines whether to serialize the property. /// public bool ShouldSerializeUnitXml() => Unit.HasValue; -#endif /// /// Returns true if this instance represents the /// Represents the Adaptive Cards Image element type. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveImage.TypeName)] -#endif public class AdaptiveImage : AdaptiveElement { /// @@ -44,9 +42,7 @@ public AdaptiveImage(Uri url) public const string TypeName = "Image"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [JsonProperty(Required = Required.Default)] public override string Type { get; set; } = TypeName; @@ -54,9 +50,7 @@ public AdaptiveImage(Uri url) /// Controls the sizing () of the displayed image. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveImageSize), "auto")] public AdaptiveImageSize Size { get; set; } @@ -64,9 +58,7 @@ public AdaptiveImage(Uri url) /// The style () in which the image is displayed. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveImageStyle), "default")] public AdaptiveImageStyle Style { get; set; } @@ -74,19 +66,15 @@ public AdaptiveImage(Uri url) /// The URL of the image. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [DefaultValue(null)] public Uri Url { get; set; } /// /// This is necessary for XML serialization. You should use the property directly. /// -#if !NETSTANDARD1_3 [XmlAttribute("Url")] [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] -#endif [JsonIgnore] public string UrlString { @@ -98,9 +86,7 @@ public string UrlString /// Horizontal alignment () to use. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveHorizontalAlignment), "left")] public AdaptiveHorizontalAlignment HorizontalAlignment { get; set; } @@ -109,9 +95,7 @@ public string UrlString /// [JsonConverter(typeof(HashColorConverter))] [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string BackgroundColor { get; set; } @@ -119,9 +103,7 @@ public string UrlString /// Action to execute when image is invoked. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlElement] -#endif [DefaultValue(null)] public AdaptiveAction SelectAction { get; set; } @@ -129,9 +111,7 @@ public string UrlString /// Alternate text (alttext) to display for this image. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string AltText { get; set; } @@ -140,9 +120,7 @@ public string UrlString /// [JsonConverter(typeof(StringSizeWithUnitConverter))] [JsonProperty("width", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(0)] public uint PixelWidth { get; set; } @@ -150,9 +128,7 @@ public string UrlString /// Explicit image height. /// [JsonIgnore] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public uint PixelHeight { get diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveImageSet.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveImageSet.cs index 6708950895..c58bc28b78 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveImageSet.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveImageSet.cs @@ -10,36 +10,28 @@ namespace AdaptiveCards /// /// Represents an ImageSet element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveImageSet.TypeName)] -#endif public class AdaptiveImageSet : AdaptiveElement { /// public const string TypeName = "ImageSet"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// /// Collection of images to display. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlElement(typeof(AdaptiveImage), ElementName = AdaptiveImage.TypeName)] -#endif public List Images { get; set; } = new List(); /// /// Specifies the of each image in the set. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveImageSize), "auto")] public AdaptiveImageSize ImageSize { get; set; } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveInline.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveInline.cs index 5d3d68362e..3915ac5c9f 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveInline.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveInline.cs @@ -18,10 +18,8 @@ public abstract class AdaptiveInline /// The type name of the inline. /// [JsonProperty(Order = -10, Required = Required.Always, DefaultValueHandling = DefaultValueHandling.Include)] -#if !NETSTANDARD1_3 // don't serialize type with xml, because we use element name or attribute for type [XmlIgnore] -#endif public abstract string Type { get; set; } /// diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveInput.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveInput.cs index df6fadadd6..c8b13a9eeb 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveInput.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveInput.cs @@ -16,9 +16,7 @@ public abstract class AdaptiveInput : AdaptiveElement /// Sets the input as required for triggering Submit actions. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool IsRequired { get; set; } @@ -26,9 +24,7 @@ public abstract class AdaptiveInput : AdaptiveElement /// Label to be shown next to input. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Label { get; set; } @@ -36,9 +32,7 @@ public abstract class AdaptiveInput : AdaptiveElement /// Error message to be shown when validation fails. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string ErrorMessage { get; set; } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveMedia.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveMedia.cs index 4894509f99..fbfb62903c 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveMedia.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveMedia.cs @@ -11,36 +11,28 @@ namespace AdaptiveCards /// /// Represents the Media element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = TypeName)] -#endif public class AdaptiveMedia : AdaptiveElement { /// public const string TypeName = "Media"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// /// A collection of source from which to retrieve the media. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlElement(Type = typeof(AdaptiveMediaSource), ElementName = "MediaSource")] -#endif public List Sources { get; set; } = new List(); /// /// URL for the poster image to show for this media element. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Poster { get; set; } @@ -48,9 +40,7 @@ public class AdaptiveMedia : AdaptiveElement /// Alternate text to display for this media element. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string AltText { get; set; } @@ -58,9 +48,7 @@ public class AdaptiveMedia : AdaptiveElement /// A collection of captions. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlElement(Type = typeof(AdaptiveCaptionSource), ElementName = "CaptionSource")] -#endif [DefaultValue(null)] public List CaptionSources { get; set; } = new List(); diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveMediaSource.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveMediaSource.cs index e0e6821448..3ffc53f657 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveMediaSource.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveMediaSource.cs @@ -10,9 +10,7 @@ namespace AdaptiveCards /// Represents a "media source" for a Media element. /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] -#if !NETSTANDARD1_3 [XmlType(TypeName = "MediaSource")] -#endif public class AdaptiveMediaSource { /// @@ -37,18 +35,14 @@ public AdaptiveMediaSource(string mimeType, string url) /// The mime type of this media source. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string MimeType { get; set; } /// /// The URL of this media source. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Url { get; set; } } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveMetadata.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveMetadata.cs index 5e6afb5bbe..ce5cfdcaf6 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveMetadata.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveMetadata.cs @@ -18,9 +18,7 @@ public class AdaptiveMetadata /// URL that uniquely identifies the card and serves as a browser fallback that can be used by some hosts. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string WebUrl { get; set; } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveNumberInput.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveNumberInput.cs index 0249f4ad6a..baa993eebd 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveNumberInput.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveNumberInput.cs @@ -10,27 +10,21 @@ namespace AdaptiveCards /// /// Represents the Input.Number element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveNumberInput.TypeName)] -#endif public class AdaptiveNumberInput : AdaptiveInput { /// public const string TypeName = "Input.Number"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// /// Text to display as a placeholder. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Placeholder { get; set; } @@ -38,9 +32,7 @@ public class AdaptiveNumberInput : AdaptiveInput /// The initial value for the field. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(double.NaN)] public double Value { get; set; } = double.NaN; @@ -48,9 +40,7 @@ public class AdaptiveNumberInput : AdaptiveInput /// Hint of minimum value (may be ignored by some clients). /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(double.NaN)] public double Min { get; set; } = double.NaN; @@ -58,9 +48,7 @@ public class AdaptiveNumberInput : AdaptiveInput /// Hint of maximum value (may be ignored by some clients). /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(double.NaN)] public double Max { get; set; } = double.NaN; diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveOpenUrlAction.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveOpenUrlAction.cs index af96177ec5..5d6979d2ae 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveOpenUrlAction.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveOpenUrlAction.cs @@ -13,37 +13,29 @@ namespace AdaptiveCards /// When ActionOpenUrl is invoked it will show the given url, either by launching it to an external web /// browser or showing in-situ with embedded web browser. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveOpenUrlAction.TypeName)] -#endif public class AdaptiveOpenUrlAction : AdaptiveAction { /// public const string TypeName = "Action.OpenUrl"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// /// Url to open using default operating system browser. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [DefaultValue(null)] public Uri Url { get; set; } /// /// This is necessary for XML serialization. You should use the property directly. /// -#if !NETSTANDARD1_3 [XmlAttribute("Url")] [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] -#endif [JsonIgnore] public string UrlString { diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveRefresh.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveRefresh.cs index a88a347536..bcdeaaa6ae 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveRefresh.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveRefresh.cs @@ -14,9 +14,7 @@ namespace AdaptiveCards /// Represents how a card can be refreshed by making a request to the target Bot /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] -#if !NETSTANDARD1_3 [XmlType(TypeName = "Refresh")] -#endif public class AdaptiveRefresh { /// @@ -24,9 +22,7 @@ public class AdaptiveRefresh /// Clients can run this refresh action automatically or can provide an affordance for users to trigger it manually. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlElement(typeof(AdaptiveExecuteAction))] -#endif public AdaptiveExecuteAction Action { get; set; } /// @@ -35,9 +31,7 @@ public class AdaptiveRefresh /// Some clients may ignore this property and always run the refresh action automatically. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public List UserIds { get; set; } = new List(); @@ -46,18 +40,14 @@ public class AdaptiveRefresh /// //[JsonConverter(typeof(IsoDateTimeConverter))] [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public DateTime? Expires { get; set; } -#if !NETSTANDARD1_3 /// /// Internal property for serializing xml. /// [XmlAttribute] [JsonIgnore] public string ExpiresXml { get => Expires?.ToString("yyyy-MM-ddTHH:mm:ssZ", CultureInfo.InvariantCulture); set => Expires = DateTime.Parse(value); } -#endif } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveRichTextBlock.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveRichTextBlock.cs index 7ef6314d9e..b01e2a91b9 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveRichTextBlock.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveRichTextBlock.cs @@ -11,18 +11,14 @@ namespace AdaptiveCards /// /// Represents the RichTextBlock element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveRichTextBlock.TypeName)] -#endif public class AdaptiveRichTextBlock : AdaptiveElement { /// public const string TypeName = "RichTextBlock"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// @@ -36,9 +32,7 @@ public AdaptiveRichTextBlock() /// Horizontal alignment for element. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveHorizontalAlignment), "left")] public AdaptiveHorizontalAlignment HorizontalAlignment { get; set; } @@ -47,9 +41,7 @@ public AdaptiveRichTextBlock() /// [JsonRequired] [JsonConverter(typeof(AdaptiveInlinesConverter))] -#if !NETSTANDARD1_3 [XmlElement(typeof(AdaptiveTextRun))] -#endif public List Inlines { get; set; } = new List(); } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveSchemaVersion.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveSchemaVersion.cs index 108e771409..6bcca25e80 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveSchemaVersion.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveSchemaVersion.cs @@ -20,17 +20,13 @@ public class AdaptiveSchemaVersion : IComparable /// /// Major version number. /// -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public int Major { get; set; } /// /// Minor version number. /// -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public int Minor { get; set; } /// diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveShowCardAction.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveShowCardAction.cs index c34f12aca0..fe43e9e5ed 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveShowCardAction.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveShowCardAction.cs @@ -8,27 +8,21 @@ namespace AdaptiveCards /// /// Represents the Action.ShowCard element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveShowCardAction.TypeName)] -#endif public class AdaptiveShowCardAction : AdaptiveAction { /// public const string TypeName = "Action.ShowCard"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// /// to show when the action is invoked. /// [JsonProperty(Required = Required.Always)] -#if !NETSTANDARD1_3 [XmlElement(typeof(AdaptiveCard), ElementName = AdaptiveCard.TypeName)] -#endif public AdaptiveCard Card { get; set; } } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveSubmitAction.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveSubmitAction.cs index b041c1e3c3..ccbf11ca5f 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveSubmitAction.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveSubmitAction.cs @@ -11,18 +11,14 @@ namespace AdaptiveCards /// asking for data to be submitted. It is up to the client to determine how that data is processed. For /// example: With BotFramework bots the client would send an activity through the messaging medium to the bot. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveSubmitAction.TypeName)] -#endif public class AdaptiveSubmitAction : AdaptiveAction { /// public const string TypeName = "Action.Submit"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// @@ -30,18 +26,14 @@ public class AdaptiveSubmitAction : AdaptiveAction /// {"id":"123123123"} /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public object Data { get; set; } /// /// Controls which inputs are associated with the submit action /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveAssociatedInputs), "auto")] public AdaptiveAssociatedInputs AssociatedInputs { get; set; } @@ -49,9 +41,7 @@ public class AdaptiveSubmitAction : AdaptiveAction /// Get or set the data as a JSON string. /// [JsonIgnore] -#if !NETSTANDARD1_3 [XmlText] -#endif public string DataJson { get diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTable.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTable.cs index e3e8090c65..3213369020 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTable.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTable.cs @@ -12,9 +12,7 @@ namespace AdaptiveCards /// Represents a table /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveTable.TypeName)] -#endif public class AdaptiveTable : AdaptiveCollectionWithContentAlignment { /// @@ -28,17 +26,13 @@ public class AdaptiveTable : AdaptiveCollectionWithContentAlignment /// /// Collection of TableRows /// -#if !NETSTANDARD1_3 [XmlElement(Type = typeof(AdaptiveTableRow), ElementName = AdaptiveTableRow.TypeName)] -#endif public List Rows{ get; set; } = new List(); /// /// Collection of TableColumnDefinitions /// -#if !NETSTANDARD1_3 [XmlElement(Type = typeof(AdaptiveTableColumnDefinition), ElementName = AdaptiveTableColumnDefinition.TypeName)] -#endif public List Columns{ get; set; } = new List(); /// @@ -67,13 +61,10 @@ public override void Add(AdaptiveElement element) /// [JsonConverter(typeof(IgnoreNullEnumConverter), true)] [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [DefaultValue(null)] public AdaptiveContainerStyle? GridStyle { get; set; } -#if !NETSTANDARD1_3 /// /// Controls XML serialization of style. /// @@ -87,15 +78,12 @@ public override void Add(AdaptiveElement element) /// Determines whether to serialize the style for XML. /// public bool ShouldSerializeGridStyleXml() => this.GridStyle.HasValue; -#endif /// /// Specifies whether grid lines should be displayed. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(true)] public bool ShowGridLines { get; set; } = true; @@ -103,9 +91,7 @@ public override void Add(AdaptiveElement element) /// Specifies whether the first row of the table should be treated as a header row, and be announced as such by accessibility software. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(true)] public bool FirstRowAsHeaders { get; set; } = true; } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTableCell.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTableCell.cs index 51a43a4473..c73d137caa 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTableCell.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTableCell.cs @@ -12,18 +12,14 @@ namespace AdaptiveCards /// Represents a cell within a row of a Table element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveTableCell.TypeName)] -#endif public class AdaptiveTableCell : AdaptiveCollectionWithContentAlignment { /// public const string TypeName = "TableCell"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [JsonProperty(Required = Required.Default)] public override string Type { get; set; } = TypeName; @@ -31,13 +27,10 @@ public class AdaptiveTableCell : AdaptiveCollectionWithContentAlignment /// Sets the text flow direction /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [DefaultValue(null)] public bool? Rtl { get; set; } = null; -#if !NETSTANDARD1_3 /// /// Controls XML serialization of style. /// @@ -51,14 +44,12 @@ public class AdaptiveTableCell : AdaptiveCollectionWithContentAlignment /// Determines whether to serialize the style for XML. /// public bool ShouldSerializeRtlXml() => this.Rtl.HasValue; -#endif /// /// Elements within this container. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] [JsonConverter(typeof(IgnoreEmptyItemsConverter))] -#if !NETSTANDARD1_3 [XmlElement(typeof(AdaptiveTextBlock))] [XmlElement(typeof(AdaptiveRichTextBlock))] [XmlElement(typeof(AdaptiveImage))] @@ -76,7 +67,6 @@ public class AdaptiveTableCell : AdaptiveCollectionWithContentAlignment [XmlElement(typeof(AdaptiveActionSet))] [XmlElement(typeof(AdaptiveTable))] [XmlElement(typeof(AdaptiveUnknownElement))] -#endif public List Items { get; set; } = new List(); /// diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTableColumnDefinition.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTableColumnDefinition.cs index 516d317456..8307abf4f6 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTableColumnDefinition.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTableColumnDefinition.cs @@ -12,9 +12,7 @@ namespace AdaptiveCards /// /// Represents the backgroundImage property /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveTableColumnDefinition.TypeName)] -#endif [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class AdaptiveTableColumnDefinition { @@ -27,9 +25,7 @@ public class AdaptiveTableColumnDefinition /// The content alignment for the TableCells inside the TableRow. /// [JsonProperty("verticalCellContentAlignment", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveVerticalContentAlignment), "top")] public AdaptiveVerticalContentAlignment VerticalContentAlignment { get; set; } @@ -37,17 +33,13 @@ public class AdaptiveTableColumnDefinition /// The content alignment for the TableCells inside the TableRow. /// [JsonProperty("horizontalCellContentAlignment", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveHorizontalContentAlignment), "left")] public AdaptiveHorizontalContentAlignment HorizontalContentAlignment { get; set; } [JsonConverter(typeof(TableColumnWidthConverter))] [JsonProperty("width", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(0)] private TableColumnWidth TableColumnWidth { get; set; } = new TableColumnWidth(); diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTableRow.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTableRow.cs index 509cf9601e..ed92cd7bb7 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTableRow.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTableRow.cs @@ -12,18 +12,14 @@ namespace AdaptiveCards /// /// Represents TableRow element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveTableRow.TypeName)] -#endif public class AdaptiveTableRow : AdaptiveCollectionWithContentAlignment { /// public const string TypeName = "TableRow"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [JsonProperty(Required = Required.Default)] public override string Type { get; set; } = TypeName; @@ -32,9 +28,7 @@ public class AdaptiveTableRow : AdaptiveCollectionWithContentAlignment /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlElement(Type = typeof(AdaptiveTableCell), ElementName = AdaptiveTableCell.TypeName)] -#endif public List Cells{ get; set; } = new List(); /// @@ -56,13 +50,10 @@ public override void Add(AdaptiveElement value) /// Sets the content flow direction /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [DefaultValue(null)] public bool? Rtl { get; set; } = null; -#if !NETSTANDARD1_3 /// /// Controls XML serialization of style. /// @@ -76,7 +67,6 @@ public override void Add(AdaptiveElement value) /// Determines whether to serialize the style for XML. /// public bool ShouldSerializeRtlXml() => this.Rtl.HasValue; -#endif } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTargetElement.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTargetElement.cs index d2dc7160c9..af1428d598 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTargetElement.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTargetElement.cs @@ -43,21 +43,16 @@ public AdaptiveTargetElement(string elementId, bool isVisible) /// /// Target element Id. /// -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string ElementId { get; set; } /// /// Target element visibility. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public bool? IsVisible { get; set; } = null; -#if !NETSTANDARD1_3 /// /// Helper to do custom serialization of property for XML. /// @@ -70,7 +65,6 @@ public AdaptiveTargetElement(string elementId, bool isVisible) /// Determines whether the property should be serialized. /// public bool ShouldSerializeIsVisibleXml() => this.IsVisible.HasValue; -#endif /// /// Implicit conversion from to . diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTextBlock.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTextBlock.cs index 567bb9f3af..d9eeafa71d 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTextBlock.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTextBlock.cs @@ -9,18 +9,14 @@ namespace AdaptiveCards /// /// Represents the TextBlock element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveTextBlock.TypeName)] -#endif public class AdaptiveTextBlock : AdaptiveElement, IAdaptiveTextElement { /// public const string TypeName = "TextBlock"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// @@ -41,64 +37,48 @@ public AdaptiveTextBlock(string text) /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveTextSize), "normal")] public AdaptiveTextSize Size { get; set; } /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveTextWeight), "normal")] public AdaptiveTextWeight Weight { get; set; } /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveTextColor), "default")] public AdaptiveTextColor Color { get; set; } /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool IsSubtle { get; set; } /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool Italic { get; set; } /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool Strikethrough { get; set; } /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlText] -#endif public string Text { get; set; } = ""; /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveHorizontalAlignment), "left")] public AdaptiveHorizontalAlignment HorizontalAlignment { get; set; } @@ -106,9 +86,7 @@ public AdaptiveTextBlock(string text) /// Controls text wrapping behavior. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool Wrap { get; set; } @@ -116,9 +94,7 @@ public AdaptiveTextBlock(string text) /// When is true, this controls the maximum number of lines of text to display. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(0)] public int MaxLines { get; set; } @@ -126,17 +102,13 @@ public AdaptiveTextBlock(string text) /// The maximum width of the TextBlock. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(0)] public int MaxWidth { get; set; } /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveFontType), "default")] public AdaptiveFontType FontType { get; set; } @@ -144,9 +116,7 @@ public AdaptiveTextBlock(string text) /// The style () of text. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveTextBlockStyle), "paragraph")] public AdaptiveTextBlockStyle Style { get; set; } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTextInput.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTextInput.cs index 8cc797f3f0..714593b458 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTextInput.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTextInput.cs @@ -9,27 +9,21 @@ namespace AdaptiveCards /// /// Represents an Input.Text element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveTextInput.TypeName)] -#endif public class AdaptiveTextInput : AdaptiveInput { /// public const string TypeName = "Input.Text"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// /// Placeholder text to display when the input is empty. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Placeholder { get; set; } @@ -37,9 +31,7 @@ public class AdaptiveTextInput : AdaptiveInput /// The initial value for the field. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Value { get; set; } @@ -47,9 +39,7 @@ public class AdaptiveTextInput : AdaptiveInput /// Hint of style of input, if client doesn't support the style it will become simple text input. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveTextInputStyle), "text")] public AdaptiveTextInputStyle Style { get; set; } @@ -57,9 +47,7 @@ public class AdaptiveTextInput : AdaptiveInput /// Controls whether multiple lines of text are allowed. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool IsMultiline { get; set; } @@ -67,9 +55,7 @@ public class AdaptiveTextInput : AdaptiveInput /// Hint of maximum number of characters to collect (may be ignored by some clients). /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(0)] public int MaxLength { get; set; } @@ -77,14 +63,12 @@ public class AdaptiveTextInput : AdaptiveInput /// to invoke inline. /// [JsonProperty("inlineAction", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlElement(typeof(AdaptiveOpenUrlAction))] [XmlElement(typeof(AdaptiveShowCardAction))] [XmlElement(typeof(AdaptiveSubmitAction))] [XmlElement(typeof(AdaptiveToggleVisibilityAction))] [XmlElement(typeof(AdaptiveExecuteAction))] [XmlElement(typeof(AdaptiveUnknownAction))] -#endif public AdaptiveAction InlineAction { get; set; } /// @@ -97,9 +81,7 @@ public override string GetNonInteractiveValue() /// Regular expression used for validating the input. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Regex { get; set; } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTextRun.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTextRun.cs index 2db8f7140e..006e3c6653 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTextRun.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTextRun.cs @@ -11,9 +11,7 @@ namespace AdaptiveCards /// Represents a TextRun. /// [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveTextRun.TypeName)] -#endif public class AdaptiveTextRun : AdaptiveInline, IAdaptiveTextElement { /// @@ -40,72 +38,54 @@ public AdaptiveTextRun(string text) /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveTextSize), "normal")] public AdaptiveTextSize Size { get; set; } /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveTextWeight), "normal")] public AdaptiveTextWeight Weight { get; set; } /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveTextColor), "default")] public AdaptiveTextColor Color { get; set; } /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool IsSubtle { get; set; } /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool Italic { get; set; } /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool Strikethrough { get; set; } /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool Highlight { get; set; } /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlText] -#endif public string Text { get; set; } = " "; /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(typeof(AdaptiveFontType), "default")] public AdaptiveFontType FontType { get; set; } @@ -113,9 +93,7 @@ public AdaptiveTextRun(string text) /// Action for this text run /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlElement] -#endif [DefaultValue(null)] public AdaptiveAction SelectAction { get; set; } @@ -123,9 +101,7 @@ public AdaptiveTextRun(string text) /// Display this text underlined. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool Underline { get; set; } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTimeInput.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTimeInput.cs index fd439fb5e0..fb7b2e1a23 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTimeInput.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTimeInput.cs @@ -9,27 +9,21 @@ namespace AdaptiveCards /// /// Represents the Input.Time element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveTimeInput.TypeName)] -#endif public class AdaptiveTimeInput : AdaptiveInput { /// public const string TypeName = "Input.Time"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// /// Placeholder text to display when the input is empty. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Placeholder { get; set; } @@ -37,9 +31,7 @@ public class AdaptiveTimeInput : AdaptiveInput /// The initial value for the field. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Value { get; set; } @@ -47,9 +39,7 @@ public class AdaptiveTimeInput : AdaptiveInput /// Hint of minimum value (may be ignored by some clients). /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Min { get; set; } @@ -57,9 +47,7 @@ public class AdaptiveTimeInput : AdaptiveInput /// Hint of maximum value (may be ignored by some clients) /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Max { get; set; } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveToggleInput.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveToggleInput.cs index a3106187e3..daed49e751 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveToggleInput.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveToggleInput.cs @@ -9,27 +9,21 @@ namespace AdaptiveCards /// /// Represents the Input.Toggle element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveToggleInput.TypeName)] -#endif public class AdaptiveToggleInput : AdaptiveInput { /// public const string TypeName = "Input.Toggle"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// /// Title text for this element. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Title { get; set; } @@ -37,9 +31,7 @@ public class AdaptiveToggleInput : AdaptiveInput /// Value to use when toggle is on. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string ValueOn { get; set; } = bool.TrueString; @@ -47,9 +39,7 @@ public class AdaptiveToggleInput : AdaptiveInput /// Value to use when toggle is off. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string ValueOff { get; set; } = bool.FalseString; @@ -57,9 +47,7 @@ public class AdaptiveToggleInput : AdaptiveInput /// Controls text wrapping behavior. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(false)] public bool Wrap { get; set; } @@ -67,9 +55,7 @@ public class AdaptiveToggleInput : AdaptiveInput /// The value for the field. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Value { get; set; } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveToggleVisibilityAction.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveToggleVisibilityAction.cs index 941358ef72..2a2ddbe33a 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveToggleVisibilityAction.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveToggleVisibilityAction.cs @@ -9,18 +9,14 @@ namespace AdaptiveCards /// /// Represents the Action.ToggleVisibility element. /// -#if !NETSTANDARD1_3 [XmlType(TypeName = AdaptiveToggleVisibilityAction.TypeName)] -#endif public class AdaptiveToggleVisibilityAction : AdaptiveAction { /// public const string TypeName = "Action.ToggleVisibility"; /// -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public override string Type { get; set; } = TypeName; /// @@ -28,9 +24,7 @@ public class AdaptiveToggleVisibilityAction : AdaptiveAction /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] [JsonConverter(typeof(ToggleElementsConverter))] -#if !NETSTANDARD1_3 [XmlElement] -#endif public List TargetElements { get; set; } = new List(); } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTokenExchangeResource.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTokenExchangeResource.cs index cb60f84f3e..a95746972c 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTokenExchangeResource.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTokenExchangeResource.cs @@ -14,9 +14,7 @@ public class AdaptiveTokenExchangeResource /// The unique identifier of this token exchange instance. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Id { get; set; } /// @@ -24,18 +22,14 @@ public class AdaptiveTokenExchangeResource /// This property is identity provider- and application-specific. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string Uri { get; set; } /// /// An identifier for the identity provider with which to attempt a token exchange. /// [JsonRequired] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public string ProviderId { get; set; } } } diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTypedElement.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTypedElement.cs index 0359dd4ceb..46525efa96 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTypedElement.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTypedElement.cs @@ -20,10 +20,8 @@ public abstract class AdaptiveTypedElement /// The AdaptiveCard element that this class implements. /// [JsonProperty(Order = -10, Required = Required.Always, DefaultValueHandling = DefaultValueHandling.Include)] -#if !NETSTANDARD1_3 // don't serialize type with xml, because we use element name or attribute for type [XmlIgnore] -#endif public abstract string Type { get; set; } /// @@ -48,9 +46,7 @@ public abstract class AdaptiveTypedElement /// [JsonConverter(typeof(AdaptiveFallbackConverter))] [JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlElement] -#endif [DefaultValue(null)] public AdaptiveFallbackElement Fallback { get; set; } @@ -58,19 +54,15 @@ public abstract class AdaptiveTypedElement /// The for this element. /// [JsonIgnore] -#if !NETSTANDARD1_3 // don't serialize type with xml, because we use element name or attribute for type [XmlIgnore] -#endif public AdaptiveInternalID InternalID { get; set; } /// /// A unique ID associated with the element. For Inputs, the ID will be used as the key for Action.Submit response. /// [JsonProperty(Order = -9, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif [DefaultValue(null)] public string Id { get; set; } @@ -78,9 +70,7 @@ public abstract class AdaptiveTypedElement /// A collection representing features and feature versions that this element requires. /// [JsonProperty(Order = 1, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif [DefaultValue(null)] public IDictionary Requires; diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveWidth.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveWidth.cs index 243be9998c..3a67921d20 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveWidth.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveWidth.cs @@ -115,21 +115,16 @@ public AdaptiveWidth(AdaptiveWidthType widthType) /// The this instance represents. /// [JsonProperty("WidthType")] -#if !NETSTANDARD1_3 [XmlAttribute] -#endif public AdaptiveWidthType WidthType { get; set; } /// /// The specific Width to use (only valid for the type). /// [JsonProperty("unit")] -#if !NETSTANDARD1_3 [XmlIgnore] -#endif public uint? Unit { get; set; } -#if !NETSTANDARD1_3 /// /// Helper to aid in XML serialization of the property. /// @@ -141,7 +136,6 @@ public AdaptiveWidth(AdaptiveWidthType widthType) /// Determines whether to serialize the property. /// public bool ShouldSerializeUnitXml() => Unit.HasValue; -#endif /// /// Returns true if this instance represents the : Dictionary, IXmlSerializable @@ -83,5 +82,4 @@ public void WriteXml(System.Xml.XmlWriter writer) #endregion } #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member -#endif } diff --git a/source/dotnet/Samples/WPFVisualizer/Properties/Resources.Designer.cs b/source/dotnet/Samples/WPFVisualizer/Properties/Resources.Designer.cs index 56b68acbdc..c2faf4e041 100644 --- a/source/dotnet/Samples/WPFVisualizer/Properties/Resources.Designer.cs +++ b/source/dotnet/Samples/WPFVisualizer/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 From 49c8089fd7d764de447048623fcba3a30236be13 Mon Sep 17 00:00:00 2001 From: Tom Laird-McConnell Date: Mon, 6 May 2024 15:43:38 -0700 Subject: [PATCH 3/5] undo change to net6 project# --- source/dotnet/Library/AdaptiveCards.Net6/AdaptiveCards.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dotnet/Library/AdaptiveCards.Net6/AdaptiveCards.csproj b/source/dotnet/Library/AdaptiveCards.Net6/AdaptiveCards.csproj index 01edeaf685..69fd38d1f2 100644 --- a/source/dotnet/Library/AdaptiveCards.Net6/AdaptiveCards.csproj +++ b/source/dotnet/Library/AdaptiveCards.Net6/AdaptiveCards.csproj @@ -56,10 +56,10 @@ - + From 1abc4e2002274230b1500513ce3ff2e2eeb99647 Mon Sep 17 00:00:00 2001 From: Tom Laird-McConnell Date: Mon, 13 May 2024 07:52:31 -0700 Subject: [PATCH 4/5] it's evil to use exceptions to add items to a list --- source/dotnet/Library/AdaptiveCards/ParseContext.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/source/dotnet/Library/AdaptiveCards/ParseContext.cs b/source/dotnet/Library/AdaptiveCards/ParseContext.cs index 4171937634..08045397e9 100644 --- a/source/dotnet/Library/AdaptiveCards/ParseContext.cs +++ b/source/dotnet/Library/AdaptiveCards/ParseContext.cs @@ -118,14 +118,10 @@ public void PopElement() // add an entry for this element if it's fallback (we'll add one when we parse it for non-fallback) if (!isFallback) { - try - { - elementIds[elementID].Add(nearestFallbackID); - } - catch (KeyNotFoundException) - { + if (!elementIds.TryGetValue(elementID, out var list)) elementIds[elementID] = new List() { nearestFallbackID }; - } + else + list.Add(nearestFallbackID); } } idStack.Pop(); From 89dd8336629c1d3e21909d2ed6787a4b7386d687 Mon Sep 17 00:00:00 2001 From: Tom Laird-McConnell Date: Tue, 28 May 2024 12:24:01 -0700 Subject: [PATCH 5/5] classes missing camelcasing attribute --- .../dotnet/Library/AdaptiveCards/AdaptiveAuthCardButton.cs | 2 ++ .../dotnet/Library/AdaptiveCards/AdaptiveAuthentication.cs | 7 +++++-- .../Library/AdaptiveCards/AdaptiveTokenExchangeResource.cs | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveAuthCardButton.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveAuthCardButton.cs index 017781f055..6d1fa8350d 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveAuthCardButton.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveAuthCardButton.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; using System.Xml.Serialization; namespace AdaptiveCards @@ -8,6 +9,7 @@ namespace AdaptiveCards /// /// Class for AuthCardButton /// + [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class AdaptiveAuthCardButton { /// diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveAuthentication.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveAuthentication.cs index 2572e7b39b..c6fe2f4657 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveAuthentication.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveAuthentication.cs @@ -1,7 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; using System.Collections.Generic; +using System.Net; using System.Xml.Serialization; namespace AdaptiveCards @@ -9,6 +11,7 @@ namespace AdaptiveCards /// /// Class to for authentication data. /// + [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class AdaptiveAuthentication { /// @@ -16,14 +19,14 @@ public class AdaptiveAuthentication /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] [XmlAttribute] - public string Text { get; set; } + public string Text { get; set; } = "Please sign in"; /// /// The identifier for registered OAuth connection setting information. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] [XmlAttribute] - public string ConnectionName { get; set; } + public string ConnectionName { get; set; } = "Default"; /// /// Provides information required to enable on-behalf-of single sign-on user authentication. diff --git a/source/dotnet/Library/AdaptiveCards/AdaptiveTokenExchangeResource.cs b/source/dotnet/Library/AdaptiveCards/AdaptiveTokenExchangeResource.cs index a95746972c..687dfe882a 100644 --- a/source/dotnet/Library/AdaptiveCards/AdaptiveTokenExchangeResource.cs +++ b/source/dotnet/Library/AdaptiveCards/AdaptiveTokenExchangeResource.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; using System.Xml.Serialization; namespace AdaptiveCards @@ -8,6 +9,7 @@ namespace AdaptiveCards /// /// Class for TokenExchangeResource /// + [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] public class AdaptiveTokenExchangeResource { ///