public static SharpAssemblyName GetNameOfReference(AssemblyReader asm, uint AsmRefIndex) { SharpAssemblyName name = new SharpAssemblyName(); if ((AssemblyRef[])asm.MetadataTable.Tables[AssemblyRef.TABLE_ID] == null) return name; AssemblyRef aref = ((AssemblyRef[])asm.MetadataTable.Tables[AssemblyRef.TABLE_ID])[AsmRefIndex]; name.Name = asm.GetStringFromHeap(aref.Name); name.Version = new Version(aref.Major, aref.Minor, aref.Build, aref.Revision); name.Culture = asm.GetStringFromHeap(aref.Culture); name.Flags = aref.Flags; name.PublicKey = asm.GetBlobFromHeap(aref.PublicKeyOrToken); return name; }
public static SharpAssemblyName GetAssemblyName(AssemblyReader asm) { SharpAssemblyName name = new SharpAssemblyName(); if ((Rows.Assembly[])asm.MetadataTable.Tables[Rows.Assembly.TABLE_ID] == null) return name; Rows.Assembly arow = ((Rows.Assembly[])asm.MetadataTable.Tables[Rows.Assembly.TABLE_ID])[1]; name.Name = asm.GetStringFromHeap(arow.Name); name.Version = new Version(arow.MajorVersion, arow.MinorVersion, arow.BuildNumber, arow.RevisionNumber); name.Culture = asm.GetStringFromHeap(arow.Culture); name.Flags = arow.Flags; name.PublicKey = asm.GetBlobFromHeap(arow.PublicKey); return name; }