-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* * update xml serialization tests to use all of the scenario folders * Fix XmlSerialization breaks which crept in because serialization test was pinned to v1.0 scenario files * Fixed xml serialization of nullable types * fix truly strange implementation of AdaptiveHeight "struct" * add copyright
- Loading branch information
1 parent
5211c46
commit 3ca37b1
Showing
17 changed files
with
246 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Xml.Serialization; | ||
|
||
namespace AdaptiveCards | ||
{ | ||
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] | ||
public abstract class AdaptiveInline | ||
{ | ||
/// <summary> | ||
/// The type name of the inline | ||
/// </summary> | ||
[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; } | ||
|
||
/// <summary> | ||
/// Additional properties not found on the default schema | ||
/// </summary> | ||
[JsonExtensionData] | ||
#if NETSTANDARD1_3 | ||
public IDictionary<string, object> AdditionalProperties { get; set; } = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase); | ||
#else | ||
// Dictionary<> is not supported with XmlSerialization because Dictionary is not serializable, SerializableDictionary<> is | ||
[XmlElement] | ||
public SerializableDictionary<string, object> AdditionalProperties { get; set; } = new SerializableDictionary<string, object>(StringComparer.OrdinalIgnoreCase); | ||
public bool ShouldSerializeAdditionalProperties() => this.AdditionalProperties.Count > 0; | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.