@@ -105,15 +105,15 @@ private static WriteObjectDelegate GetWriteFn()
105105 static Func < T , bool > GetShouldSerializeMethod ( MemberInfo member )
106106 {
107107 var method = member . DeclaringType . GetInstanceMethod ( "ShouldSerialize" + member . Name ) ;
108- return method == null || method . ReturnType != typeof ( bool )
109- ? null
108+ return method == null || method . ReturnType != typeof ( bool )
109+ ? null
110110 : ( Func < T , bool > ) method . CreateDelegate ( typeof ( Func < T , bool > ) ) ;
111111 }
112112
113113 static Func < T , string , bool ? > ShouldSerialize ( Type type )
114114 {
115115 var method = type . GetMethodInfo ( "ShouldSerialize" ) ;
116- return method == null || method . ReturnType != typeof ( bool ? )
116+ return method == null || method . ReturnType != typeof ( bool ? )
117117 ? null
118118 : ( Func < T , string , bool ? > ) method . CreateDelegate ( typeof ( Func < T , string , bool ? > ) ) ;
119119 }
@@ -147,10 +147,10 @@ private static bool Init()
147147 int propertyOrder = - 1 ;
148148 var propertyType = propertyInfo . PropertyType ;
149149 var defaultValue = propertyType . GetDefaultValue ( ) ;
150- bool propertySuppressDefaultConfig = defaultValue != null
151- && propertyType . IsValueType ( )
152- && ! propertyType . IsEnum ( )
153- && JsConfig . HasSerializeFn . Contains ( propertyType )
150+ bool propertySuppressDefaultConfig = defaultValue != null
151+ && propertyType . IsValueType ( )
152+ && ! propertyType . IsEnum ( )
153+ && JsConfig . HasSerializeFn . Contains ( propertyType )
154154 && ! JsConfig . HasIncludeDefaultValue . Contains ( propertyType ) ;
155155 bool propertySuppressDefaultAttribute = false ;
156156
@@ -202,9 +202,9 @@ private static bool Init()
202202 int propertyOrder = - 1 ;
203203 var propertyType = fieldInfo . FieldType ;
204204 var defaultValue = propertyType . GetDefaultValue ( ) ;
205- bool propertySuppressDefaultConfig = defaultValue != null
206- && propertyType . IsValueType ( ) && ! propertyType . IsEnum ( )
207- && JsConfig . HasSerializeFn . Contains ( propertyType )
205+ bool propertySuppressDefaultConfig = defaultValue != null
206+ && propertyType . IsValueType ( ) && ! propertyType . IsEnum ( )
207+ && JsConfig . HasSerializeFn . Contains ( propertyType )
208208 && ! JsConfig . HasIncludeDefaultValue . Contains ( propertyType ) ;
209209 bool propertySuppressDefaultAttribute = false ;
210210#if ( NETFX_CORE )
@@ -281,11 +281,11 @@ internal string PropertyName
281281 internal readonly Func < T , string , bool ? > shouldSerializeDynamic ;
282282 internal readonly bool isEnum ;
283283
284- public TypePropertyWriter ( string propertyName , string propertyDeclaredTypeName , string propertyNameCLSFriendly ,
285- string propertyNameLowercaseUnderscore , int propertyOrder , bool propertySuppressDefaultConfig , bool propertySuppressDefaultAttribute ,
286- Func < T , object > getterFn , WriteObjectDelegate writeFn , object defaultValue ,
287- Func < T , bool > shouldSerialize ,
288- Func < T , string , bool ? > shouldSerializeDynamic ,
284+ public TypePropertyWriter ( string propertyName , string propertyDeclaredTypeName , string propertyNameCLSFriendly ,
285+ string propertyNameLowercaseUnderscore , int propertyOrder , bool propertySuppressDefaultConfig , bool propertySuppressDefaultAttribute ,
286+ Func < T , object > getterFn , WriteObjectDelegate writeFn , object defaultValue ,
287+ Func < T , bool > shouldSerialize ,
288+ Func < T , string , bool ? > shouldSerializeDynamic ,
289289 bool isEnum )
290290 {
291291 this . propertyName = propertyName ;
@@ -394,7 +394,7 @@ public static void WriteProperties(TextWriter writer, object value)
394394 {
395395 var propertyWriter = PropertyWriters [ index ] ;
396396
397- if ( propertyWriter . shouldSerialize != null && ! propertyWriter . shouldSerialize ( ( T ) value ) )
397+ if ( propertyWriter . shouldSerialize != null && ! propertyWriter . shouldSerialize ( ( T ) value ) )
398398 continue ;
399399
400400 var dontSkipDefault = false ;
@@ -442,7 +442,7 @@ public static void WriteProperties(TextWriter writer, object value)
442442 finally
443443 {
444444 if ( typeof ( TSerializer ) == typeof ( JsonTypeSerializer ) ) JsState . IsWritingValue = false ;
445- }
445+ }
446446 }
447447 }
448448
@@ -526,7 +526,7 @@ public static void WriteQueryString(TextWriter writer, object value)
526526 var isEnumerable = strValue == null
527527 && ! ( propertyType . IsValueType ( ) )
528528 && propertyType . HasInterface ( typeof ( IEnumerable ) ) ;
529-
529+
530530 if ( QueryStringSerializer . ComplexTypeStrategy != null
531531 && ! isEnumerable && ( propertyType . IsUserType ( ) || propertyType . IsInterface ( ) ) )
532532 {
@@ -546,12 +546,12 @@ public static void WriteQueryString(TextWriter writer, object value)
546546 propertyWriter . WriteFn ( writer , propertyValue ) ;
547547 }
548548 else
549- {
549+ {
550550 //Trim brackets in top-level lists in QueryStrings, e.g: ?a=[1,2,3] => ?a=1,2,3
551551 using ( var ms = MemoryStreamFactory . GetStream ( ) )
552552 {
553553 var enumerableWriter = new StreamWriter ( ms ) ; //ms disposed in using
554- propertyWriter . WriteFn ( enumerableWriter , propertyValue ) ;
554+ propertyWriter . WriteFn ( enumerableWriter , propertyValue ) ;
555555 enumerableWriter . Flush ( ) ;
556556 var output = ms . ToArray ( ) . FromUtf8Bytes ( ) ;
557557 output = output . Trim ( ArrayBrackets ) ;
0 commit comments