@@ -27,14 +27,14 @@ public static async Task DownloadAsync<TDataSet>(this IModelLoader<TDataSet> mod
2727
2828 if ( showProgressInConsole )
2929 {
30- Console . WriteLine ( $ "Downloading { fileName } ") ;
30+ Binding . tf_output_redirect . WriteLine ( $ "Downloading { fileName } ") ;
3131 }
3232
3333 if ( File . Exists ( fileSaveTo ) )
3434 {
3535 if ( showProgressInConsole )
3636 {
37- Console . WriteLine ( $ "The file { fileName } already exists") ;
37+ Binding . tf_output_redirect . WriteLine ( $ "The file { fileName } already exists") ;
3838 }
3939
4040 return ;
@@ -64,12 +64,12 @@ public static async Task UnzipAsync<TDataSet>(this IModelLoader<TDataSet> modelL
6464 var destFilePath = Path . Combine ( saveTo , destFileName ) ;
6565
6666 if ( showProgressInConsole )
67- Console . WriteLine ( $ "Unzippinng { Path . GetFileName ( zipFile ) } ") ;
67+ Binding . tf_output_redirect . WriteLine ( $ "Unzippinng { Path . GetFileName ( zipFile ) } ") ;
6868
6969 if ( File . Exists ( destFilePath ) )
7070 {
7171 if ( showProgressInConsole )
72- Console . WriteLine ( $ "The file { destFileName } already exists") ;
72+ Binding . tf_output_redirect . WriteLine ( $ "The file { destFileName } already exists") ;
7373 }
7474
7575 using ( GZipStream unzipStream = new GZipStream ( File . OpenRead ( zipFile ) , CompressionMode . Decompress ) )
@@ -107,7 +107,7 @@ public static async Task ShowProgressInConsole(this Task task, bool enable)
107107 }
108108
109109 await showProgressTask ;
110- Console . WriteLine ( "Done." ) ;
110+ Binding . tf_output_redirect . WriteLine ( "Done." ) ;
111111 }
112112
113113 private static async Task ShowProgressInConsole ( CancellationTokenSource cts )
@@ -119,17 +119,17 @@ private static async Task ShowProgressInConsole(CancellationTokenSource cts)
119119 while ( ! cts . IsCancellationRequested )
120120 {
121121 await Task . Delay ( 100 ) ;
122- Console . Write ( "." ) ;
122+ Binding . tf_output_redirect . Write ( "." ) ;
123123 cols ++ ;
124124
125125 if ( cols % 50 == 0 )
126126 {
127- Console . WriteLine ( ) ;
127+ Binding . tf_output_redirect . WriteLine ( ) ;
128128 }
129129 }
130130
131131 if ( cols > 0 )
132- Console . WriteLine ( ) ;
132+ Binding . tf_output_redirect . WriteLine ( ) ;
133133 }
134134 }
135135}
0 commit comments