Changeset 1417 for branches/eraser6/BlackBox
- Timestamp:
- 12/23/2009 3:17:17 AM (3 years ago)
- Location:
- branches/eraser6/BlackBox
- Files:
-
- 4 edited
-
Eraser.Util/BlackBox.cs (modified) (3 diffs)
-
Eraser/BlackBoxMainForm.cs (modified) (1 diff)
-
Eraser/BlackBoxUploadForm.cs (modified) (5 diffs)
-
Eraser/Program.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/BlackBox/Eraser.Util/BlackBox.cs
r1414 r1417 530 530 DirectoryInfo directory = new DirectoryInfo(Path); 531 531 foreach (FileInfo file in directory.GetFiles()) 532 if ( file.Name != BlackBox.StackTraceFileName)532 if (!InternalFiles.Contains(file.Name)) 533 533 result.Add(file); 534 534 … … 560 560 } 561 561 562 /// <summary> 563 /// Gets or sets whether the given report has been uploaded to the server. 564 /// </summary> 565 public bool Submitted 566 { 567 get 568 { 569 byte[] buffer = new byte[1]; 570 using (FileStream stream = new FileStream(System.IO.Path.Combine(Path, StatusFileName), 571 FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read)) 572 { 573 stream.Read(buffer, 0, buffer.Length); 574 } 575 576 return buffer[0] == 1; 577 } 578 579 set 580 { 581 byte[] buffer = { Convert.ToByte(value) }; 582 using (FileStream stream = new FileStream(System.IO.Path.Combine(Path, StatusFileName), 583 FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read)) 584 { 585 stream.Write(buffer, 0, buffer.Length); 586 } 587 } 588 } 589 562 590 public override string ToString() 563 591 { … … 574 602 /// </summary> 575 603 private List<BlackBoxExceptionEntry> StackTraceCache; 604 605 /// <summary> 606 /// The file name for the status file. 607 /// </summary> 608 private static readonly string StatusFileName = "Status.txt"; 609 610 /// <summary> 611 /// The list of files internal to the report. 612 /// </summary> 613 private static readonly List<string> InternalFiles = new List<string>( 614 new string[] { 615 BlackBox.StackTraceFileName, 616 "Status.txt" 617 } 618 ); 576 619 } 577 620 -
branches/eraser6/BlackBox/Eraser/BlackBoxMainForm.cs
r1393 r1417 41 41 foreach (BlackBoxReport report in BlackBox.GetDumps()) 42 42 { 43 if (report.Submitted) 44 continue; 45 43 46 ReportsLb.Items.Add(report); 44 47 ReportsLb.SetItemChecked(ReportsLb.Items.Count - 1, true); -
branches/eraser6/BlackBox/Eraser/BlackBoxUploadForm.cs
r1415 r1417 47 47 InitializeComponent(); 48 48 UXThemeApi.UpdateControlTheme(this); 49 50 Reports = reports;51 49 UploadWorker.RunWorkerAsync(reports); 52 50 } … … 106 104 { 107 105 ProgressLbl.Text = S._("Reports submitted successfully."); 106 ProgressPb.Value = ProgressPb.Maximum; 108 107 CancelBtn.Text = S._("Close"); 109 108 } … … 125 124 Close(); 126 125 } 127 128 private IList<BlackBoxReport> Reports;129 126 } 130 127 … … 180 177 { 181 178 case "exists": 179 Report.Submitted = true; 182 180 return false; 183 181 … … 279 277 { 280 278 reportRequest.GetResponse(); 279 Report.Submitted = true; 281 280 } 282 281 catch (WebException e) -
branches/eraser6/BlackBox/Eraser/Program.cs
r1411 r1417 221 221 Application.Idle -= OnGUIIdle; 222 222 BlackBox blackBox = BlackBox.Get(); 223 if (blackBox.GetDumps().Length == 0) 223 224 bool allSubmitted = true; 225 foreach (BlackBoxReport report in blackBox.GetDumps()) 226 if (!report.Submitted) 227 { 228 allSubmitted = false; 229 break; 230 } 231 232 if (allSubmitted) 224 233 return; 225 234
Note: See TracChangeset
for help on using the changeset viewer.
