Ignore:
Timestamp:
1/5/2010 3:10:46 AM (4 years ago)
Author:
lowjoel
Message:

Added a Timestamp field to the BlackBoxReport? class to access the timestamp of the report (currently, it's just parsing the filename of the report.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/BlackBox/Eraser.Util/BlackBox.cs

    r1454 r1456  
    3333using System.Reflection; 
    3434using System.Collections.ObjectModel; 
     35using System.Globalization; 
    3536 
    3637namespace Eraser.Util 
     
    267268 
    268269            //Generate a unique identifier for this report. 
    269             string crashName = DateTime.Now.ToString("yyyyMMdd HHmmss.FFF"); 
     270            string crashName = DateTime.Now.ToString(CrashReportName, CultureInfo.InvariantCulture); 
    270271            string currentCrashReport = Path.Combine(CrashReportsPath, crashName); 
    271272            Directory.CreateDirectory(currentCrashReport); 
     
    439440 
    440441        /// <summary> 
     442        /// The report name format. 
     443        /// </summary> 
     444        internal static readonly string CrashReportName = "yyyyMMdd HHmmss.FFF"; 
     445 
     446        /// <summary> 
    441447        /// The file name of the memory dump. 
    442448        /// </summary> 
     
    530536 
    531537        /// <summary> 
     538        /// The timestamp of the report. 
     539        /// </summary> 
     540        public DateTime Timestamp 
     541        { 
     542            get 
     543            { 
     544                return DateTime.ParseExact(Name, BlackBox.CrashReportName, 
     545                    CultureInfo.InvariantCulture); 
     546            } 
     547        } 
     548 
     549        /// <summary> 
    532550        /// The path to the folder containing the report. 
    533551        /// </summary> 
Note: See TracChangeset for help on using the changeset viewer.