internal static string GetBaseDesc(this Record rec) { return("Type: " + rec.Name + Environment.NewLine + "FormID: " + rec.FormID.ToString("x8") + Environment.NewLine + "Flags 1: " + rec.Flags1.ToString("x8") + (rec.Flags1 == 0 ? string.Empty : " (" + FlagDefs.GetRecFlags1Desc(rec.Flags1) + ")") + Environment.NewLine + "Flags 2: " + rec.Flags2.ToString("x8") + Environment.NewLine + "Flags 3: " + rec.Flags3.ToString("x8") + Environment.NewLine + "Subrecords: " + rec.SubRecords.Count.ToString() + Environment.NewLine + "Size: " + rec.Size.ToString() + " bytes (excluding header)"); }
public static void GetFormattedHeader(this Record rec, RTFBuilder rb) { rb.FontStyle(FontStyle.Bold).FontSize(rb.DefaultFontSize + 4).ForeColor(KnownColor.DarkGray).AppendLine("[Record]"); rb.Append("Type: ").FontStyle(FontStyle.Bold).FontSize(rb.DefaultFontSize + 2).AppendFormat("{0}", rec.Name).AppendLine(); rb.Append("FormID: ").FontStyle(FontStyle.Bold).FontSize(rb.DefaultFontSize + 2).ForeColor(KnownColor.DarkRed).AppendFormat("{0:X8}", rec.FormID).AppendLine(); if (rec.Flags1 != 0) { rb.AppendLineFormat("Flags 1: {0:X8} : ({1} : Level = {2})", rec.Flags1, FlagDefs.GetRecFlags1Desc(rec.Flags1), rec.CompressionLevel.ToString()); } else { rb.AppendLineFormat("Flags 1: {0:X8}", rec.Flags1); } //rb.AppendLineFormat("OLD --> Flags 3: \t{0:X8}", rec.Flags3); rb.AppendLineFormat("Version Control Info: {0:X8}", rec.Flags2); //rb.AppendLineFormat("OLD --> Flags 3: \t{0:X8}", rec.Flags3); rb.AppendLineFormat("Flags 2: {0:X4}", (rec.Flags3 >> 16)); rb.AppendLineFormat("Form Version: {0:X4} : {1}", ((rec.Flags3 << 16) >> 16), ((rec.Flags3 << 16) >> 16)); rb.AppendLineFormat("Size: {0:N0}", rec.Size); rb.AppendLineFormat("Subrecords: {0}", rec.SubRecords.Count); rb.AppendPara(); }