コード例 #1
0
 public MetadataReader(MetadataHeaps heaps, MetadataToken entryPoint)
 {
     _heaps             = heaps;
     _entryPoint        = entryPoint;
     _resolveBlob       = Func.Memoize <uint, ByteBuffer>(_heaps.Blobs.ReadBlob);
     _resolveGuid       = Func.Memoize <uint, Guid>(_heaps.Guids.ReadGuid);
     _resolveString     = Func.Memoize <uint, string>(_heaps.Strings.ReadString);
     _resolveUserString = Func.Memoize <uint, string>(_heaps.UserStrings.ReadString);
 }
コード例 #2
0
 private MetadataBuilder(AssemblyDefinition assemblyDef)
 {
     _assemblyDef     = assemblyDef;
     _heaps           = new MetadataHeaps();
     _ilCode          = new ILCodeWriter(this);
     _writeBlob       = Func.Memoize <ByteBuffer, uint>(_heaps.Blobs.WriteBlob);
     _writeGuid       = Func.Memoize <Guid, uint>(_heaps.Guids.WriteGuid);
     _writeString     = Func.Memoize <string, uint>(_heaps.Strings.WriteString, StringComparer.Ordinal);
     _writeUserString = Func.Memoize <string, uint>(_heaps.UserStrings.WriteString, StringComparer.Ordinal);
     _resolveToken    = Func.Memoize <IMetadataEntity, MetadataToken>(entity => MetadataTokenResolver.ResolveToken(entity, this));
 }
コード例 #3
0
 public MetadataBuildResult(MetadataToken entryPointToken, MetadataHeaps heaps, ILCodeWriter ilCode)
 {
     EntryPointToken = entryPointToken;
     Heaps           = heaps;
     ILCode          = ilCode;
 }