Changeset 1390 for branches/eraser6/BlackBox/Eraser.Util/BlackBox.cs
- Timestamp:
- 12/21/2009 5:39:44 AM (3 years ago)
- File:
-
- 1 edited
-
branches/eraser6/BlackBox/Eraser.Util/BlackBox.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/BlackBox/Eraser.Util/BlackBox.cs
r1388 r1390 32 32 using System.Drawing.Imaging; 33 33 using System.Reflection; 34 using System.Collections.ObjectModel; 34 35 35 36 namespace Eraser.Util … … 260 261 /// </summary> 261 262 /// <returns>A string array containing the list of dumps waiting for upload.</returns> 262 public string[] GetDumps()263 public BlackBoxReport[] GetDumps() 263 264 { 264 265 DirectoryInfo dirInfo = new DirectoryInfo(CrashReportsPath); 265 List< string> result = new List<string>();266 List<BlackBoxReport> result = new List<BlackBoxReport>(); 266 267 foreach (DirectoryInfo subDir in dirInfo.GetDirectories()) 267 result.Add( subDir.Name);268 result.Add(new BlackBoxReport(Path.Combine(CrashReportsPath, subDir.Name))); 268 269 269 270 return result.ToArray(); … … 425 426 Environment.SpecialFolder.LocalApplicationData), @"Eraser 6\Crash Reports"); 426 427 } 428 429 /// <summary> 430 /// Represents one BlackBox crash report. 431 /// </summary> 432 public class BlackBoxReport 433 { 434 /// <summary> 435 /// Constructor. 436 /// </summary> 437 /// <param name="path">Path to the folder containing the memory dump, screenshot and 438 /// debug log.</param> 439 internal BlackBoxReport(string path) 440 { 441 Path = path; 442 } 443 444 /// <summary> 445 /// The name of the report. 446 /// </summary> 447 public string Name 448 { 449 get 450 { 451 return System.IO.Path.GetFileName(Path); 452 } 453 } 454 455 /// <summary> 456 /// The files which comprise the error report. 457 /// </summary> 458 public ICollection<FileInfo> Files 459 { 460 get 461 { 462 List<FileInfo> result = new List<FileInfo>(); 463 DirectoryInfo directory = new DirectoryInfo(Path); 464 result.AddRange(directory.GetFiles()); 465 return result.AsReadOnly(); 466 } 467 } 468 469 public override string ToString() 470 { 471 return Name; 472 } 473 474 /// <summary> 475 /// The path to the folder containing the report. 476 /// </summary> 477 private string Path; 478 } 427 479 }
Note: See TracChangeset
for help on using the changeset viewer.
