@@ -259,24 +259,42 @@ private void DownloadProc()
259
259
260
260
}
261
261
else if ( e . Error != null )
262
- {
263
- m_Items [ ( int ) e . UserState ] . ProgressColor = Brushes . Red ;
262
+ {
263
+ if ( m_Items [ ( int ) e . UserState ] . PdbType == 0 )
264
+ {
265
+ m_Items [ ( int ) e . UserState ] . PdbType = 1 ;
266
+ StringBuilder newUrl = new StringBuilder ( m_Items [ m_DownloadIndex ] . PdbUrl ) ;
267
+ newUrl [ newUrl . Length - 1 ] = 'b' ;
268
+ statusBarText . Dispatcher . Invoke ( new Action ( ( ) => { statusBarText . Content = "Download: " + newUrl . ToString ( ) ; } ) ) ;
269
+ m_Items [ m_DownloadIndex ] . ProgressColor = new SolidColorBrush ( Color . FromArgb ( 0xff , 0x01 , 0xd3 , 0x28 ) ) ;
270
+ m_Items [ m_DownloadIndex ] . ProgressColor . Freeze ( ) ;
271
+ m_Downloader . DownloadFileAsync ( new Uri ( newUrl . ToString ( ) ) , m_Items [ m_DownloadIndex ] . PdbPath , m_DownloadIndex ) ;
272
+ return ;
273
+ }
274
+ else
275
+ {
276
+ m_Items [ ( int ) e . UserState ] . ProgressColor = Brushes . Red ;
277
+ }
278
+
264
279
}
265
280
else
266
- {
267
- StringBuilder cab = new StringBuilder ( m_Items [ ( int ) e . UserState ] . PdbPath ) ;
268
- cab [ cab . Length - 1 ] = '_' ;
269
-
270
- Process process = new Process ( ) ;
271
- process . StartInfo . FileName = "expand.exe" ;
272
- process . StartInfo . Arguments = "expand.exe -R " + cab . ToString ( ) ;
273
- process . StartInfo . CreateNoWindow = true ;
274
- process . StartInfo . WindowStyle = ProcessWindowStyle . Hidden ;
275
- process . Start ( ) ;
276
- process . WaitForExit ( ) ;
277
- File . Delete ( cab . ToString ( ) ) ;
278
-
279
- m_Items [ ( int ) e . UserState ] . ProgressColor = Brushes . Blue ;
281
+ {
282
+ if ( m_Items [ ( int ) e . UserState ] . PdbType == 0 )
283
+ {
284
+ StringBuilder cab = new StringBuilder ( m_Items [ ( int ) e . UserState ] . PdbPath ) ;
285
+ cab [ cab . Length - 1 ] = '_' ;
286
+
287
+ Process process = new Process ( ) ;
288
+ process . StartInfo . FileName = "expand.exe" ;
289
+ process . StartInfo . Arguments = "expand.exe -R " + cab . ToString ( ) ;
290
+ process . StartInfo . CreateNoWindow = true ;
291
+ process . StartInfo . WindowStyle = ProcessWindowStyle . Hidden ;
292
+ process . Start ( ) ;
293
+ process . WaitForExit ( ) ;
294
+ File . Delete ( cab . ToString ( ) ) ;
295
+
296
+ m_Items [ ( int ) e . UserState ] . ProgressColor = Brushes . Blue ;
297
+ }
280
298
}
281
299
282
300
ev . Set ( ) ;
@@ -396,13 +414,20 @@ public string PdbUrl
396
414
{
397
415
get { return pdbUrl ; }
398
416
set { pdbUrl = value ; }
417
+ }
418
+ private int pdbType ;
419
+ public int PdbType
420
+ {
421
+ get { return pdbType ; }
422
+ set { pdbType = value ; }
399
423
}
400
424
public PdbItem ( string filePath , string pdbPath , string pdbUrl , double progress )
401
425
{
402
426
PdbPath = pdbPath ;
403
427
FilePath = filePath ;
404
428
ProgressValue = progress ;
405
- PdbUrl = pdbUrl ;
429
+ PdbUrl = pdbUrl ;
430
+ pdbType = 0 ;
406
431
}
407
432
408
433
public event PropertyChangedEventHandler PropertyChanged ;
0 commit comments