From 1947de8a84630ea5cba99100ba372f2d0d8fb2b7 Mon Sep 17 00:00:00 2001 From: Marc Hernandez Date: Thu, 4 Jul 2019 06:18:41 -0700 Subject: [PATCH] Formatter Added a feature where single field classes can just put their data into the classes v (value) attribute. --- XmlFormatter2.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/XmlFormatter2.cs b/XmlFormatter2.cs index 5455462..f05a741 100644 --- a/XmlFormatter2.cs +++ b/XmlFormatter2.cs @@ -337,13 +337,22 @@ public class XmlFormatter2 : IFormatter XmlElement childElem = getNamedChild( allChildren, name ); + if( childElem != null ) { object childObj = Deserialize( childElem, childFi.FieldType, obj ); childFi.SetValue( obj, childObj ); } - } + else if( miArr.Length == 1 ) + { + object childObj = Deserialize( elem, childFi.FieldType, obj ); + + childFi.SetValue( obj, childObj ); + } + + + } } return obj;