Exemplo n.º 1
0
 public static void Write <T>(
     this PrimitiveBinaryTranslation <T, MutagenFrame, MutagenWriter> transl,
     MutagenWriter writer,
     T item,
     RecordType header,
     Action <MutagenWriter, T>?write = null)
     where T : struct
 {
     write ??= transl.Write;
     try
     {
         using (HeaderExport.Header(writer, header, ObjectType.Subrecord))
         {
             write(writer, item);
         }
     }
     catch (Exception ex)
     {
         throw SubrecordException.Factory(ex, header);
     }
 }