private void CreateHeader() { CIHeader header = iContainer.Header; header.CrashTime = iDescriptor.MasterFile.LastWriteTime; header.FileFormatVersion = "D_EXC for Symbian OS EKA2"; }
/** Add timestamp and uptime */ internal void AddHeader(CIContainer aContainer) { CIHeader header = (CIHeader)aContainer.ChildByType(typeof(CIHeader)); if (header != null) { //Timestamp DateTime timeStamp = header.CrashTime; String date = timeStamp.ToString("yyyyMMdd", DateTimeFormatInfo.InvariantInfo); int hour = timeStamp.Hour; int minute = timeStamp.Minute; int second = timeStamp.Second; iTimeStampText = date + hour.ToString().PadLeft(2, '0') + minute.ToString().PadLeft(2, '0') + second.ToString().PadLeft(2, '0'); //UpTime iUptime = header.UpTime.TotalSeconds; // Crash source iCrashSource = header.CrashSource; } }
protected override void XmlSerializeContent(CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters) { if (aParameters.Container.Status != CrashItemLib.Crash.Container.CIContainer.TStatus.EStatusErrorContainer) { CIHeader header = aParameters.Container.Header; DateTime crashTime = header.CrashTime; // Date and time CXmlNode.WriteDate(aParameters.Writer, crashTime, SegConstants.CmnDate); CXmlNode.WriteTime(aParameters.Writer, crashTime, SegConstants.CmnTime); // Uptime double uptime = header.UpTime.TotalSeconds; if (uptime > 0) { aParameters.Writer.WriteElementString(SegConstants.Header_Uptime, uptime.ToString()); } // Underlying version information from crash file (if available) if (header.FileFormatVersion.IsValid) { CXmlVersionText version = new CXmlVersionText(header.FileFormatVersion); version.XmlSerialize(aParameters); } // Crash source if (header.CrashSource == 1) { aParameters.Writer.WriteElementString(SegConstants.Header_Crash_Source, SegConstants.Header_Crash_Source_User); } else if (header.CrashSource == 0) { aParameters.Writer.WriteElementString(SegConstants.Header_Crash_Source, SegConstants.Header_Crash_Source_Kernel); } } }