private static RuntimeAssemblyName CreateRuntimeAssemblyNameFromMetadata( MetadataReader reader, ConstantStringValueHandle name, ushort majorVersion, ushort minorVersion, ushort buildNumber, ushort revisionNumber, ConstantStringValueHandle culture, IEnumerable <byte> publicKeyOrToken, NativeFormatAssemblyFlags assemblyFlags) { AssemblyNameFlags assemblyNameFlags = AssemblyNameFlags.None; if (0 != (assemblyFlags & NativeFormatAssemblyFlags.PublicKey)) { assemblyNameFlags |= AssemblyNameFlags.PublicKey; } if (0 != (assemblyFlags & NativeFormatAssemblyFlags.Retargetable)) { assemblyNameFlags |= AssemblyNameFlags.Retargetable; } int contentType = ((int)assemblyFlags) & 0x00000E00; assemblyNameFlags |= (AssemblyNameFlags)contentType; return(new RuntimeAssemblyName( name.GetString(reader), new Version(majorVersion, minorVersion, buildNumber, revisionNumber), culture.GetStringOrNull(reader), assemblyNameFlags, publicKeyOrToken.ToArray() )); }
private static RuntimeAssemblyName CreateRuntimeAssemblyNameFromMetadata( MetadataReader reader, ConstantStringValueHandle name, ushort majorVersion, ushort minorVersion, ushort buildNumber, ushort revisionNumber, ConstantStringValueHandle culture, IEnumerable<byte> publicKeyOrToken, NativeFormatAssemblyFlags assemblyFlags) { AssemblyNameFlags assemblyNameFlags = AssemblyNameFlags.None; if (0 != (assemblyFlags & NativeFormatAssemblyFlags.PublicKey)) assemblyNameFlags |= AssemblyNameFlags.PublicKey; if (0 != (assemblyFlags & NativeFormatAssemblyFlags.Retargetable)) assemblyNameFlags |= AssemblyNameFlags.Retargetable; int contentType = ((int)assemblyFlags) & 0x00000E00; assemblyNameFlags |= (AssemblyNameFlags)contentType; return new RuntimeAssemblyName( name.GetString(reader), new Version(majorVersion, minorVersion, buildNumber, revisionNumber), culture.GetStringOrNull(reader), assemblyNameFlags, publicKeyOrToken.ToArray() ); }