public MetadataTableNode(MetadataTableVM mdTable) : base(mdTable.Span) { TableInfo = mdTable.TableInfo; MetadataTableVM = mdTable; MetadataTableVM.Owner = this; }
public void WriteHeader(IDecompilerOutput output) { var cols = MetadataTableVM.TableInfo.Columns; output.Write($"{dnSpy_AsmEditor_Resources.RowIdentifier}\t{dnSpy_AsmEditor_Resources.Token}\t{dnSpy_AsmEditor_Resources.Offset}", BoxedTextColor.Comment); for (int i = 0; i < cols.Count; i++) { output.Write("\t", BoxedTextColor.Comment); output.Write(MetadataTableVM.GetColumnName(i), BoxedTextColor.Comment); } if (MetadataTableVM.HasInfo) { output.Write("\t", BoxedTextColor.Comment); output.Write(MetadataTableVM.InfoName, BoxedTextColor.Comment); } output.WriteLine(); }
protected override void DecompileFields(IDecompiler decompiler, IDecompilerOutput output) { decompiler.WriteCommentLine(output, string.Empty); decompiler.WriteCommentBegin(output, true); WriteHeader(output); decompiler.WriteCommentEnd(output, true); output.WriteLine(); for (int i = 0; i < (int)MetadataTableVM.Rows; i++) { var obj = MetadataTableVM.Get(i); decompiler.WriteCommentBegin(output, true); Write(output, obj); decompiler.WriteCommentEnd(output, true); output.WriteLine(); } }