Exemple #1
0
        public static void GetFormattedData(this Record rec, RTFBuilder rb)
        {
            try
            {
                rb.FontStyle(FontStyle.Bold).FontSize(rb.DefaultFontSize).ForeColor(KnownColor.DarkGray).AppendLine("[Formatted information]");
                rb.Reset();

                RecordStructure recordStructure;
                if (!RecordStructure.Records.TryGetValue(rec.Name, out recordStructure))
                {
                    return;
                }

                rb.FontStyle(FontStyle.Bold).ForeColor(KnownColor.DarkBlue).FontSize(rb.DefaultFontSize + 4).AppendLine(recordStructure.description);
                foreach (var subrec in rec.SubRecords)
                {
                    if (subrec.Structure == null || subrec.Structure.elements == null || subrec.Structure.notininfo)
                    {
                        continue;
                    }

                    rb.AppendLine();
                    subrec.GetFormattedData(rb);
                }
            }
            catch
            {
                rb.ForeColor(KnownColor.Red).Append("Warning: An error occurred while processing the record. It may not conform to the structure defined in RecordStructure.xml");
            }
        }
Exemple #2
0
        public override void GetFormattedHeader(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}", Name).AppendLine();
            rb.Append("FormID: ").FontStyle(FontStyle.Bold).FontSize(rb.DefaultFontSize + 2).ForeColor(KnownColor.DarkRed).AppendFormat("{0:X8}", this.FormID).AppendLine();

            if (this.Flags1 != 0)
            {
                rb.AppendLineFormat("Flags 1: {0:X8} : ({1} : Level = {2})", this.Flags1, FlagDefs.GetRecFlags1Desc(this.Flags1), compressLevel.ToString());
            }
            else
                rb.AppendLineFormat("Flags 1: {0:X8}", this.Flags1);

            //rb.AppendLineFormat("OLD --> Flags 3: \t{0:X8}", this.Flags3);
            rb.AppendLineFormat("Version Control Info: {0:X8}", this.Flags2);

            //rb.AppendLineFormat("OLD --> Flags 3: \t{0:X8}", this.Flags3);
            rb.AppendLineFormat("Flags 2: {0:X4}", (this.Flags3 >> 16));
            rb.AppendLineFormat("Form Version: {0:X4} : {1}", ((this.Flags3 << 16) >> 16), ((this.Flags3 << 16) >> 16));

            rb.AppendLineFormat("Size: {0:N0}", this.Size);
            rb.AppendLineFormat("Subrecords: {0}", this.SubRecords.Count);
            rb.AppendPara();
        }
Exemple #3
0
        public override void GetFormattedHeader(RTFBuilder rb)
        {
            rb.FontStyle(FontStyle.Bold).FontSize(rb.DefaultFontSize + 4).ForeColor(KnownColor.DarkGray).AppendLine(
                "[Record]");


            rb.Append("Type: \t").FontStyle(FontStyle.Bold).FontSize(rb.DefaultFontSize + 2).AppendFormat("{0}", Name).
                AppendLine();
            rb.Append("FormID: \t").FontStyle(FontStyle.Bold).FontSize(rb.DefaultFontSize + 2).ForeColor(
                KnownColor.DarkRed).AppendFormat("{0:X8}", FormID).AppendLine();
            rb.AppendLineFormat("Flags 1: \t{0:X8}", Flags1);
            if (Flags1 != 0) rb.AppendLineFormat(" ({0})", FlagDefs.GetRecFlags1Desc(Flags1));
            rb.AppendLineFormat("Flags 2: \t{0:X8}", Flags2);
            rb.AppendLineFormat("Flags 3: \t{0:X8}", Flags3);
            rb.AppendLineFormat("Size: \t{0:N0}", Size);
            rb.AppendLineFormat("Subrecords:\t{0}", SubRecords.Count);
            rb.AppendPara();
        }
Exemple #4
0
 public static void GetFormattedHeader(this SubRecord rec, RTFBuilder s)
 {
     s.FontStyle(FontStyle.Bold).FontSize(s.DefaultFontSize + 4).ForeColor(KnownColor.DarkGray).AppendLine("[Subrecord data]");
 }