@@ -39,7 +39,8 @@ public static TomlSerializationMethods.Serialize<object> For(Type type, TomlSeri
3939 {
4040 inline = GenericExtensions . GetCustomAttribute < TomlInlineCommentProviderAttribute > ( f ) ,
4141 preceding = GenericExtensions . GetCustomAttribute < TomlPrecedingCommentProviderAttribute > ( f ) ,
42- noInline = GenericExtensions . GetCustomAttribute < TomlDoNotInlineObjectAttribute > ( f )
42+ noInline = GenericExtensions . GetCustomAttribute < TomlDoNotInlineObjectAttribute > ( f ) ,
43+ paddingLines = GenericExtensions . GetCustomAttribute < TomlPaddingLinesAttribute > ( f ) ,
4344 } ) ;
4445 var props = type . GetProperties ( memberFlags )
4546 . ToArray ( ) ;
@@ -49,7 +50,8 @@ public static TomlSerializationMethods.Serialize<object> For(Type type, TomlSeri
4950 inline = GenericExtensions . GetCustomAttribute < TomlInlineCommentProviderAttribute > ( p ) ,
5051 preceding = GenericExtensions . GetCustomAttribute < TomlPrecedingCommentProviderAttribute > ( p ) ,
5152 prop = GenericExtensions . GetCustomAttribute < TomlPropertyAttribute > ( p ) ,
52- noInline = GenericExtensions . GetCustomAttribute < TomlDoNotInlineObjectAttribute > ( p )
53+ noInline = GenericExtensions . GetCustomAttribute < TomlDoNotInlineObjectAttribute > ( p ) ,
54+ paddingLines = GenericExtensions . GetCustomAttribute < TomlPaddingLinesAttribute > ( p ) ,
5355 } ) ;
5456
5557 var isForcedNoInline = GenericExtensions . GetCustomAttribute < TomlDoNotInlineObjectAttribute > ( type ) != null ;
@@ -94,6 +96,7 @@ public static TomlSerializationMethods.Serialize<object> For(Type type, TomlSeri
9496
9597 tomlValue . Comments . InlineComment = commentAttribs . inline ? . GetComment ( ) ;
9698 tomlValue . Comments . PrecedingComment = commentAttribs . preceding ? . GetComment ( ) ;
99+ tomlValue . Comments . PrecedingPaddingLines = commentAttribs . paddingLines ? . PaddingLines ?? 0 ;
97100
98101 if ( commentAttribs . noInline != null && tomlValue is TomlTable table )
99102 table . ForceNoInline = true ;
@@ -123,6 +126,7 @@ public static TomlSerializationMethods.Serialize<object> For(Type type, TomlSeri
123126
124127 tomlValue . Comments . InlineComment = thisPropAttribs . inline ? . GetComment ( ) ;
125128 tomlValue . Comments . PrecedingComment = thisPropAttribs . preceding ? . GetComment ( ) ;
129+ tomlValue . Comments . PrecedingPaddingLines = thisPropAttribs . paddingLines ? . PaddingLines ?? 0 ;
126130
127131 if ( thisPropAttribs . noInline != null && tomlValue is TomlTable table )
128132 table . ForceNoInline = true ;
0 commit comments