File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -57,26 +57,17 @@ public async Task<bool> Serialize()
5757 await sw . WriteAsync ( String . Format ( ",\" {0}\" " , Header ) ) ;
5858 ++ index ;
5959 }
60+ await sw . WriteAsync ( sw . NewLine ) ;
6061 }
6162 foreach ( Row row in ( Document != null ? Document . Rows : Rows ) )
6263 {
6364 short index = 0 ;
6465 foreach ( Value value in row . Values )
6566 {
66- if ( value . Type == typeof ( String ) )
67- {
68- if ( index == 0 )
69- await sw . WriteAsync ( String . Format ( "\" {0}\" " , value ) ) ;
70- else
71- await sw . WriteAsync ( String . Format ( ",\" {0}\" " , value ) ) ;
72- }
67+ if ( index == 0 )
68+ await sw . WriteAsync ( String . Format ( "\" {0}\" " , value ) ) ;
7369 else
74- {
75- if ( index == 0 )
76- await sw . WriteAsync ( value . ToString ( ) ) ;
77- else
78- await sw . WriteAsync ( "," + value . ToString ( ) ) ;
79- }
70+ await sw . WriteAsync ( String . Format ( ",\" {0}\" " , value ) ) ;
8071 ++ index ;
8172 }
8273 await sw . WriteLineAsync ( sw . NewLine ) ;
@@ -87,5 +78,6 @@ public async Task<bool> Serialize()
8778 }
8879 catch { return false ; }
8980 }
81+ //TODO: call this serializeAsync and create a synchronous method as well
9082 }
9183}
You can’t perform that action at this time.
0 commit comments