153 references to MetadataReader
Microsoft.CodeAnalysis (153)
DiagnosticAnalyzer\AnalyzerFileReference.cs (2)
361
var declaringTypeDef = peModule.
MetadataReader
.GetTypeDefinition(declaringType);
362
return GetFullyQualifiedTypeName(declaringTypeDef, peModule) + "+" + peModule.
MetadataReader
.GetString(typeDef.Name);
Emit\EditAndContinue\EmitBaseline.cs (1)
351
var reader = module.Module.
MetadataReader
;
MetadataReader\MetadataDecoder.cs (4)
1141
var signatureHandle = Module.
MetadataReader
.GetStandaloneSignature(handle).Signature;
1142
var signatureReader = Module.
MetadataReader
.GetBlobReader(signatureHandle);
1180
var reader = Module.
MetadataReader
;
2039
var interfaceImpl = Module.
MetadataReader
.GetInterfaceImplementation(interfaceImplHandle);
MetadataReader\PEAssembly.cs (1)
192
var value = _modules[0].
MetadataReader
.DeclaresTheObjectClass();
MetadataReader\PEModule.cs (143)
282
return
MetadataReader
.IsAssembly;
290
return !
MetadataReader
.IsAssembly;
358
_lazyName =
MetadataReader
.GetString(
MetadataReader
.GetModuleDefinition().Name);
368
return
MetadataReader
.GetModuleVersionIdOrThrow();
384
foreach (var fileHandle in
MetadataReader
.AssemblyFiles)
386
var file =
MetadataReader
.GetAssemblyFile(fileHandle);
392
string moduleName =
MetadataReader
.GetString(file.Name);
416
foreach (var handle in
MetadataReader
.TypeReferences)
418
TypeReference typeRef =
MetadataReader
.GetTypeReference(handle);
434
if (
MetadataReader
.ManifestResources.Count == 0)
440
foreach (var handle in
MetadataReader
.ManifestResources)
442
var resource =
MetadataReader
.GetManifestResource(handle);
445
string resourceName =
MetadataReader
.GetString(resource.Name);
456
return
MetadataReader
.GetString(
MetadataReader
.GetModuleReference(moduleRef).Name);
470
_lazyAssemblyReferences = this.
MetadataReader
.GetReferencedAssembliesOrThrow();
483
get { return
MetadataReader
.MetadataVersion; }
493
return
MetadataReader
.GetBlobReader(blob);
499
var attributeTypeName =
MetadataReader
.GetString(nameHandle);
500
var attributeTypeNamespaceName =
MetadataReader
.GetString(namespaceHandle);
512
return
MetadataReader
.ReadAssemblyIdentityOrThrow();
522
return
MetadataReader
.GetTypeDefinition(typeDef).GetDeclaringType();
528
TypeDefinition typeDefinition =
MetadataReader
.GetTypeDefinition(typeDef);
529
string name =
MetadataReader
.GetString(typeDefinition.Name);
544
string namespaceName =
MetadataReader
.GetString(typeDefinition.Namespace);
560
return
MetadataReader
.GetString(
MetadataReader
.GetTypeDefinition(typeDef).Namespace);
566
return
MetadataReader
.GetTypeDefinition(typeDef).BaseType;
572
return
MetadataReader
.GetTypeDefinition(typeDef).Attributes;
578
return
MetadataReader
.GetTypeDefinition(typeDef).GetGenericParameters();
584
return
MetadataReader
.GetTypeDefinition(typeDef).GetGenericParameters().Count > 0;
595
TypeDefinition row =
MetadataReader
.GetTypeDefinition(typeDef);
596
name =
MetadataReader
.GetString(row.Name);
597
@namespace =
MetadataReader
.GetString(row.Namespace);
605
return IsNestedTypeDefOrThrow(
MetadataReader
, typeDef);
617
return
MetadataReader
.GetTypeDefinition(typeDef).Attributes.IsInterface();
635
foreach (var typeDef in
MetadataReader
.TypeDefinitions)
637
var row =
MetadataReader
.GetTypeDefinition(typeDef);
762
string @namespace =
MetadataReader
.GetString(kvp.Key);
861
select
MetadataReader
.GetString(id.NamespaceHandle);
879
return
MetadataReader
.GetTypeDefinition(container).GetNestedTypes();
885
return
MetadataReader
.GetTypeDefinition(typeDef).GetMethodImplementations();
894
return
MetadataReader
.GetTypeDefinition(typeDef).GetInterfaceImplementations();
900
return
MetadataReader
.GetTypeDefinition(typeDef).GetMethods();
906
return
MetadataReader
.GetTypeDefinition(typeDef).GetProperties();
912
return
MetadataReader
.GetTypeDefinition(typeDef).GetEvents();
918
return
MetadataReader
.GetTypeDefinition(typeDef).GetFields();
924
return
MetadataReader
.GetTypeDefinition(typeDef).BaseType;
934
var def =
MetadataReader
.GetTypeDefinition(typeDef);
1142
AttributeInfo info = FindTargetAttribute(
MetadataReader
, token, AttributeDescription.RefSafetyRulesAttribute, out foundAttributeType);
1791
blobReader =
MetadataReader
.GetBlobReader(valueBlob);
2002
BlobReader reader =
MetadataReader
.GetBlobReader(valueBlob);
2100
BlobReader reader =
MetadataReader
.GetBlobReader(valueBlob);
2493
foreach (var attributeHandle in
MetadataReader
.GetCustomAttributes(hasAttribute))
2517
return FindTargetAttribute(
MetadataReader
, hasAttribute, description, out _);
2552
foreach (var attributeHandle in
MetadataReader
.GetCustomAttributes(hasAttribute))
2573
foreach (var attributeHandle in
MetadataReader
.GetCustomAttributes(hasAttribute))
2595
int rid =
MetadataReader
.GetRowNumber(typeDef);
2609
foreach (var attributeHandle in
MetadataReader
.GetCustomAttributes(typeDef))
2637
new int[(
MetadataReader
.TypeDefinitions.Count + 32) / 32],
2692
if (
MetadataReader
.GetCustomAttribute(customAttribute).Parent.Kind != HandleKind.TypeDefinition)
2722
return IsTargetAttribute(
MetadataReader
, customAttribute, namespaceName, typeName, out ctor, ignoreCase);
2783
foreach (var assemblyRef in
MetadataReader
.AssemblyReferences)
2786
if (
MetadataReader
.StringComparer.Equals(
MetadataReader
.GetAssemblyReference(assemblyRef).Name, assemblyName))
2802
return
MetadataReader
.GetAssemblyReference(assemblyRef);
2824
foreach (var handle in
MetadataReader
.TypeReferences)
2826
var typeRef =
MetadataReader
.GetTypeReference(handle);
2835
if (!
MetadataReader
.StringComparer.Equals(typeRef.Name, typeName))
2840
if (
MetadataReader
.StringComparer.Equals(typeRef.Namespace, namespaceName))
2861
TypeReference typeRef =
MetadataReader
.GetTypeReference(handle);
2863
name =
MetadataReader
.GetString(typeRef.Name);
2865
@namespace =
MetadataReader
.GetString(typeRef.Namespace);
2882
return GetTargetAttributeSignatureIndex(
MetadataReader
, customAttribute, description, out _);
3031
return GetTypeAndConstructor(
MetadataReader
, customAttribute, out ctorType, out attributeCtor);
3101
return GetAttributeNamespaceAndName(
MetadataReader
, typeDefOrRef, out namespaceHandle, out nameHandle);
3172
foreach (var attributeHandle in
MetadataReader
.CustomAttributes)
3181
var parent = (TypeDefinitionHandle)
MetadataReader
.GetCustomAttribute(attributeHandle).Parent;
3254
BlobHandle signature =
MetadataReader
.GetTypeSpecification(typeSpec).Signature;
3257
return
MetadataReader
.GetBlobReader(signature);
3267
var methodSpec =
MetadataReader
.GetMethodSpecification(handle);
3282
GenericParameter row =
MetadataReader
.GetGenericParameter(handle);
3283
name =
MetadataReader
.GetString(row.Name);
3294
return
MetadataReader
.GetString(
MetadataReader
.GetMethodDefinition(methodDef).Name);
3300
return GetMethodSignatureOrThrow(
MetadataReader
, methodDef);
3312
return GetMethodSignatureOrThrow(
MetadataReader
, methodDefOrRef);
3334
return
MetadataReader
.GetMethodDefinition(methodDef).Attributes;
3340
return
MetadataReader
.GetMethodDefinition(methodDef).GetDeclaringType();
3346
return
MetadataReader
.GetFieldDefinition(fieldDef).GetDeclaringType();
3352
return
MetadataReader
.GetMemberReference(memberRef).Parent;
3363
MethodDefinition methodRow =
MetadataReader
.GetMethodDefinition(methodDef);
3364
name =
MetadataReader
.GetString(methodRow.Name);
3377
var impl =
MetadataReader
.GetMethodImplementation(methodImpl);
3385
return
MetadataReader
.GetMethodDefinition(methodDef).GetGenericParameters();
3391
return
MetadataReader
.GetMethodDefinition(methodDef).GetParameters();
3398
var methodImport =
MetadataReader
.GetMethodDefinition(methodDef).GetImport();
3406
string entryPointName =
MetadataReader
.GetString(methodImport.Name);
3424
return GetMemberRefNameOrThrow(
MetadataReader
, memberRef);
3436
return GetSignatureOrThrow(
MetadataReader
, memberRef);
3452
MemberReference row =
MetadataReader
.GetMemberReference(memberRef);
3454
name =
MetadataReader
.GetString(row.Name);
3455
signature =
MetadataReader
.GetBlobBytes(row.Signature);
3468
Parameter parameter =
MetadataReader
.GetParameter(parameterDef);
3469
name =
MetadataReader
.GetString(parameter.Name);
3476
Parameter parameter =
MetadataReader
.GetParameter(parameterDef);
3477
return
MetadataReader
.GetString(parameter.Name);
3483
return
MetadataReader
.GetParameter(param).SequenceNumber;
3493
return
MetadataReader
.GetString(
MetadataReader
.GetPropertyDefinition(propertyDef).Name);
3499
return
MetadataReader
.GetPropertyDefinition(propertyDef).Signature;
3508
PropertyDefinition property =
MetadataReader
.GetPropertyDefinition(propertyDef);
3509
name =
MetadataReader
.GetString(property.Name);
3520
return
MetadataReader
.GetString(
MetadataReader
.GetEventDefinition(eventDef).Name);
3530
EventDefinition eventRow =
MetadataReader
.GetEventDefinition(eventDef);
3531
name =
MetadataReader
.GetString(eventRow.Name);
3543
return
MetadataReader
.GetString(
MetadataReader
.GetFieldDefinition(fieldDef).Name);
3549
return
MetadataReader
.GetFieldDefinition(fieldDef).Signature;
3555
return
MetadataReader
.GetFieldDefinition(fieldDef).Attributes;
3564
FieldDefinition fieldRow =
MetadataReader
.GetFieldDefinition(fieldDef);
3566
name =
MetadataReader
.GetString(fieldRow.Name);
3576
var constantHandle =
MetadataReader
.GetParameter(param).GetDefaultValue();
3593
var constantHandle =
MetadataReader
.GetFieldDefinition(fieldDef).GetDefaultValue();
3611
return
MetadataReader
.GetCustomAttributes(handle);
3617
return
MetadataReader
.GetCustomAttribute(handle).Value;
3626
MetadataReader
.GetFieldDefinition((FieldDefinitionHandle)fieldOrParameterToken).GetMarshallingDescriptor() :
3627
MetadataReader
.GetParameter((ParameterHandle)fieldOrParameterToken).GetMarshallingDescriptor();
3642
byte firstByte =
MetadataReader
.GetBlobReader(blob).ReadByte();
3664
return
MetadataReader
.GetBlobBytes(blob).AsImmutableOrNull();
3676
int offset =
MetadataReader
.GetFieldDefinition(fieldDef).GetOffset();
3693
var constantRow =
MetadataReader
.GetConstant(handle);
3694
BlobReader reader =
MetadataReader
.GetBlobReader(constantRow.Value);
3820
var forwarders =
MetadataReader
.ExportedTypes;
3823
ExportedType exportedType =
MetadataReader
.GetExportedType(handle);
3850
string name =
MetadataReader
.GetString(exportedType.Name);
3854
string namespaceString =
MetadataReader
.GetString(ns);
3916
return
MetadataReader
.GetPropertyDefinition(propertyDef).GetAccessors();
3922
return
MetadataReader
.GetEventDefinition(eventDef).GetAccessors();
3928
return
MetadataReader
.GetRowNumber(assemblyRef) - 1;
3958
MethodDefinition method =
MetadataReader
.GetMethodDefinition(methodHandle);
MetadataReference\AssemblyMetadata.cs (1)
421
if (!module.IsLinkedModule && module.
MetadataReader
.MetadataKind != MetadataKind.WindowsMetadata)
MetadataReference\ModuleMetadata.cs (1)
374
internal MetadataReader MetadataReader => Module.
MetadataReader
;