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);
1796
blobReader =
MetadataReader
.GetBlobReader(valueBlob);
2007
BlobReader reader =
MetadataReader
.GetBlobReader(valueBlob);
2105
BlobReader reader =
MetadataReader
.GetBlobReader(valueBlob);
2498
foreach (var attributeHandle in
MetadataReader
.GetCustomAttributes(hasAttribute))
2522
return FindTargetAttribute(
MetadataReader
, hasAttribute, description, out _);
2557
foreach (var attributeHandle in
MetadataReader
.GetCustomAttributes(hasAttribute))
2578
foreach (var attributeHandle in
MetadataReader
.GetCustomAttributes(hasAttribute))
2600
int rid =
MetadataReader
.GetRowNumber(typeDef);
2614
foreach (var attributeHandle in
MetadataReader
.GetCustomAttributes(typeDef))
2642
new int[(
MetadataReader
.TypeDefinitions.Count + 32) / 32],
2697
if (
MetadataReader
.GetCustomAttribute(customAttribute).Parent.Kind != HandleKind.TypeDefinition)
2727
return IsTargetAttribute(
MetadataReader
, customAttribute, namespaceName, typeName, out ctor, ignoreCase);
2788
foreach (var assemblyRef in
MetadataReader
.AssemblyReferences)
2791
if (
MetadataReader
.StringComparer.Equals(
MetadataReader
.GetAssemblyReference(assemblyRef).Name, assemblyName))
2807
return
MetadataReader
.GetAssemblyReference(assemblyRef);
2829
foreach (var handle in
MetadataReader
.TypeReferences)
2831
var typeRef =
MetadataReader
.GetTypeReference(handle);
2840
if (!
MetadataReader
.StringComparer.Equals(typeRef.Name, typeName))
2845
if (
MetadataReader
.StringComparer.Equals(typeRef.Namespace, namespaceName))
2866
TypeReference typeRef =
MetadataReader
.GetTypeReference(handle);
2868
name =
MetadataReader
.GetString(typeRef.Name);
2870
@namespace =
MetadataReader
.GetString(typeRef.Namespace);
2887
return GetTargetAttributeSignatureIndex(
MetadataReader
, customAttribute, description, out _);
3036
return GetTypeAndConstructor(
MetadataReader
, customAttribute, out ctorType, out attributeCtor);
3106
return GetAttributeNamespaceAndName(
MetadataReader
, typeDefOrRef, out namespaceHandle, out nameHandle);
3177
foreach (var attributeHandle in
MetadataReader
.CustomAttributes)
3186
var parent = (TypeDefinitionHandle)
MetadataReader
.GetCustomAttribute(attributeHandle).Parent;
3259
BlobHandle signature =
MetadataReader
.GetTypeSpecification(typeSpec).Signature;
3262
return
MetadataReader
.GetBlobReader(signature);
3272
var methodSpec =
MetadataReader
.GetMethodSpecification(handle);
3287
GenericParameter row =
MetadataReader
.GetGenericParameter(handle);
3288
name =
MetadataReader
.GetString(row.Name);
3299
return
MetadataReader
.GetString(
MetadataReader
.GetMethodDefinition(methodDef).Name);
3305
return GetMethodSignatureOrThrow(
MetadataReader
, methodDef);
3317
return GetMethodSignatureOrThrow(
MetadataReader
, methodDefOrRef);
3339
return
MetadataReader
.GetMethodDefinition(methodDef).Attributes;
3345
return
MetadataReader
.GetMethodDefinition(methodDef).GetDeclaringType();
3351
return
MetadataReader
.GetFieldDefinition(fieldDef).GetDeclaringType();
3357
return
MetadataReader
.GetMemberReference(memberRef).Parent;
3368
MethodDefinition methodRow =
MetadataReader
.GetMethodDefinition(methodDef);
3369
name =
MetadataReader
.GetString(methodRow.Name);
3382
var impl =
MetadataReader
.GetMethodImplementation(methodImpl);
3390
return
MetadataReader
.GetMethodDefinition(methodDef).GetGenericParameters();
3396
return
MetadataReader
.GetMethodDefinition(methodDef).GetParameters();
3403
var methodImport =
MetadataReader
.GetMethodDefinition(methodDef).GetImport();
3411
string entryPointName =
MetadataReader
.GetString(methodImport.Name);
3429
return GetMemberRefNameOrThrow(
MetadataReader
, memberRef);
3441
return GetSignatureOrThrow(
MetadataReader
, memberRef);
3457
MemberReference row =
MetadataReader
.GetMemberReference(memberRef);
3459
name =
MetadataReader
.GetString(row.Name);
3460
signature =
MetadataReader
.GetBlobBytes(row.Signature);
3473
Parameter parameter =
MetadataReader
.GetParameter(parameterDef);
3474
name =
MetadataReader
.GetString(parameter.Name);
3481
Parameter parameter =
MetadataReader
.GetParameter(parameterDef);
3482
return
MetadataReader
.GetString(parameter.Name);
3488
return
MetadataReader
.GetParameter(param).SequenceNumber;
3498
return
MetadataReader
.GetString(
MetadataReader
.GetPropertyDefinition(propertyDef).Name);
3504
return
MetadataReader
.GetPropertyDefinition(propertyDef).Signature;
3513
PropertyDefinition property =
MetadataReader
.GetPropertyDefinition(propertyDef);
3514
name =
MetadataReader
.GetString(property.Name);
3525
return
MetadataReader
.GetString(
MetadataReader
.GetEventDefinition(eventDef).Name);
3535
EventDefinition eventRow =
MetadataReader
.GetEventDefinition(eventDef);
3536
name =
MetadataReader
.GetString(eventRow.Name);
3548
return
MetadataReader
.GetString(
MetadataReader
.GetFieldDefinition(fieldDef).Name);
3554
return
MetadataReader
.GetFieldDefinition(fieldDef).Signature;
3560
return
MetadataReader
.GetFieldDefinition(fieldDef).Attributes;
3569
FieldDefinition fieldRow =
MetadataReader
.GetFieldDefinition(fieldDef);
3571
name =
MetadataReader
.GetString(fieldRow.Name);
3581
var constantHandle =
MetadataReader
.GetParameter(param).GetDefaultValue();
3598
var constantHandle =
MetadataReader
.GetFieldDefinition(fieldDef).GetDefaultValue();
3616
return
MetadataReader
.GetCustomAttributes(handle);
3622
return
MetadataReader
.GetCustomAttribute(handle).Value;
3631
MetadataReader
.GetFieldDefinition((FieldDefinitionHandle)fieldOrParameterToken).GetMarshallingDescriptor() :
3632
MetadataReader
.GetParameter((ParameterHandle)fieldOrParameterToken).GetMarshallingDescriptor();
3647
byte firstByte =
MetadataReader
.GetBlobReader(blob).ReadByte();
3669
return
MetadataReader
.GetBlobBytes(blob).AsImmutableOrNull();
3681
int offset =
MetadataReader
.GetFieldDefinition(fieldDef).GetOffset();
3698
var constantRow =
MetadataReader
.GetConstant(handle);
3699
BlobReader reader =
MetadataReader
.GetBlobReader(constantRow.Value);
3825
var forwarders =
MetadataReader
.ExportedTypes;
3828
ExportedType exportedType =
MetadataReader
.GetExportedType(handle);
3855
string name =
MetadataReader
.GetString(exportedType.Name);
3859
string namespaceString =
MetadataReader
.GetString(ns);
3921
return
MetadataReader
.GetPropertyDefinition(propertyDef).GetAccessors();
3927
return
MetadataReader
.GetEventDefinition(eventDef).GetAccessors();
3933
return
MetadataReader
.GetRowNumber(assemblyRef) - 1;
3963
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
;