void IMetadataProvider.Read(TokenTypes token, out AssemblyRefRow result) { TableHeap theap = (TableHeap)_streams[(int)HeapType.Tables]; theap.Read(token, out result); }
/// <summary> /// Reads the specified token. /// </summary> /// <param name="token">The token.</param> /// <param name="result">The result.</param> public void Read(TokenTypes token, out AssemblyRefRow result) { if ((token & TokenTypes.TableMask) != TokenTypes.AssemblyRef) throw new ArgumentException ("Invalid token type for AssemblyRefRow.", "token"); using (BinaryReader reader = CreateReaderForToken (token)) { result = new AssemblyRefRow (reader.ReadUInt16 (), reader.ReadUInt16 (), reader.ReadUInt16 (), reader.ReadUInt16 (), (AssemblyFlags)reader.ReadUInt32 (), ReadIndexValue (reader, IndexType.BlobHeap), ReadIndexValue (reader, IndexType.StringHeap), ReadIndexValue (reader, IndexType.StringHeap), ReadIndexValue (reader, IndexType.BlobHeap)); } }
/// <summary> /// Resolves the given assembly reference and loads the associated IMetadataModule. /// </summary> /// <param name="provider">The metadata provider, which contained the assembly reference.</param> /// <param name="assemblyRef">The assembly reference to resolve.</param> /// <returns> /// An instance of IMetadataModule representing the resolved assembly. /// </returns> public IMetadataModule Resolve(IMetadataProvider provider, AssemblyRefRow assemblyRef) { string name; provider.Read(assemblyRef.NameIdx, out name); IMetadataModule result = GetLoadedAssembly(name) ?? DoLoadAssembly(name + ".dll"); if (result == null) throw new TypeLoadException(); return result; }
public AssemblyRefRowExt(IMetadataProvider metadata, AssemblyRefRow row) : base(metadata) { this.row = row; }