@@ -166,13 +166,12 @@ void OnSplitSyncProgressChanged(string? sender, SyncProgressChangedEventArgs arg
166
166
167
167
await InstallMultipleRemotePackageAsync ( baseRemoteFilePath , splitRemoteFilePaths , callback , cancellationToken , arguments ) ;
168
168
169
- callback ? . Invoke ( new InstallProgressEventArgs ( 0 , splitRemoteFilePaths . Length + 1 , PackageInstallProgressState . PostInstall ) ) ;
170
169
int count = 0 ;
170
+ callback ? . Invoke ( new InstallProgressEventArgs ( 0 , splitRemoteFilePaths . Length + 1 , PackageInstallProgressState . PostInstall ) ) ;
171
171
await splitRemoteFilePaths . Select ( async x =>
172
172
{
173
- count ++ ;
174
173
await RemoveRemotePackageAsync ( x , cancellationToken ) . ConfigureAwait ( false ) ;
175
- callback ? . Invoke ( new InstallProgressEventArgs ( count , splitRemoteFilePaths . Length + 1 , PackageInstallProgressState . PostInstall ) ) ;
174
+ callback ? . Invoke ( new InstallProgressEventArgs ( ++ count , splitRemoteFilePaths . Length + 1 , PackageInstallProgressState . PostInstall ) ) ;
176
175
} ) . WhenAll ( ) . ConfigureAwait ( false ) ;
177
176
178
177
if ( count < splitRemoteFilePaths . Length )
@@ -240,13 +239,12 @@ void OnSyncProgressChanged(string? sender, SyncProgressChangedEventArgs args)
240
239
241
240
await InstallMultipleRemotePackageAsync ( splitRemoteFilePaths , packageName , callback , cancellationToken , arguments ) ;
242
241
243
- callback ? . Invoke ( new InstallProgressEventArgs ( 0 , splitRemoteFilePaths . Length , PackageInstallProgressState . PostInstall ) ) ;
244
242
int count = 0 ;
243
+ callback ? . Invoke ( new InstallProgressEventArgs ( 0 , splitRemoteFilePaths . Length , PackageInstallProgressState . PostInstall ) ) ;
245
244
await splitRemoteFilePaths . Select ( async x =>
246
245
{
247
- count ++ ;
248
246
await RemoveRemotePackageAsync ( x , cancellationToken ) . ConfigureAwait ( false ) ;
249
- callback ? . Invoke ( new InstallProgressEventArgs ( count , splitRemoteFilePaths . Length , PackageInstallProgressState . PostInstall ) ) ;
247
+ callback ? . Invoke ( new InstallProgressEventArgs ( ++ count , splitRemoteFilePaths . Length , PackageInstallProgressState . PostInstall ) ) ;
250
248
} ) . WhenAll ( ) . ConfigureAwait ( false ) ;
251
249
252
250
if ( count < splitRemoteFilePaths . Length )
@@ -284,10 +282,10 @@ public async Task InstallMultipleRemotePackageAsync(string baseRemoteFilePath, I
284
282
callback ? . Invoke ( new InstallProgressEventArgs ( 1 , splitRemoteFileCount + 1 , PackageInstallProgressState . WriteSession ) ) ;
285
283
286
284
int count = 0 ;
287
- await splitRemoteFilePaths . Select ( async splitRemoteFilePath =>
285
+ await splitRemoteFilePaths . Select ( async ( splitRemoteFilePath , index ) =>
288
286
{
289
- await WriteInstallSessionAsync ( session , $ "split{ count ++ } ", splitRemoteFilePath , cancellationToken ) . ConfigureAwait ( false ) ;
290
- callback ? . Invoke ( new InstallProgressEventArgs ( count , splitRemoteFileCount + 1 , PackageInstallProgressState . WriteSession ) ) ;
287
+ await WriteInstallSessionAsync ( session , $ "split{ index } ", splitRemoteFilePath , cancellationToken ) . ConfigureAwait ( false ) ;
288
+ callback ? . Invoke ( new InstallProgressEventArgs ( ++ count , splitRemoteFileCount + 1 , PackageInstallProgressState . WriteSession ) ) ;
291
289
} ) . WhenAll ( ) . ConfigureAwait ( false ) ;
292
290
293
291
if ( count < splitRemoteFileCount )
@@ -329,10 +327,10 @@ public async Task InstallMultipleRemotePackageAsync(IEnumerable<string> splitRem
329
327
callback ? . Invoke ( new InstallProgressEventArgs ( 0 , splitRemoteFileCount , PackageInstallProgressState . WriteSession ) ) ;
330
328
331
329
int count = 0 ;
332
- await splitRemoteFilePaths . Select ( async splitRemoteFilePath =>
330
+ await splitRemoteFilePaths . Select ( async ( splitRemoteFilePath , index ) =>
333
331
{
334
- await WriteInstallSessionAsync ( session , $ "split{ count ++ } ", splitRemoteFilePath , cancellationToken ) . ConfigureAwait ( false ) ;
335
- callback ? . Invoke ( new InstallProgressEventArgs ( count , splitRemoteFileCount , PackageInstallProgressState . WriteSession ) ) ;
332
+ await WriteInstallSessionAsync ( session , $ "split{ index } ", splitRemoteFilePath , cancellationToken ) . ConfigureAwait ( false ) ;
333
+ callback ? . Invoke ( new InstallProgressEventArgs ( ++ count , splitRemoteFileCount , PackageInstallProgressState . WriteSession ) ) ;
336
334
} ) . WhenAll ( ) . ConfigureAwait ( false ) ;
337
335
338
336
if ( count < splitRemoteFileCount )
0 commit comments