1 write to Context
Microsoft.CodeAnalysis (1)
PEWriter\MetadataVisitor.cs (1)
24this.Context = context;
82 references to Context
Microsoft.CodeAnalysis (82)
Emit\EditAndContinue\DeltaMetadataWriter.cs (1)
1872var methodDef = (IMethodDefinition?)methodImplementation.ImplementingMethod.AsDefinition(this.Context);
PEWriter\MetadataVisitor.cs (25)
29this.Visit(arrayTypeReference.GetElementType(Context)); 54IMethodReference constructor = customAttribute.Constructor(Context, reportDiagnostics: false); 60this.Visit(customAttribute.GetArguments(Context)); 62this.Visit(customAttribute.GetNamedArguments(Context)); 75this.Visit(customModifier.GetModifier(Context)); 88this.Visit(eventDefinition.GetAccessors(Context)); 89this.Visit(eventDefinition.GetType(Context)); 102var constant = fieldDefinition.GetCompileTimeValue(Context); 122this.Visit(fieldDefinition.GetType(Context)); 164this.Visit(genericParameter.GetAttributes(Context)); 165this.Visit(genericParameter.GetConstraints(Context)); 295this.Visit(method.GetReturnValueAttributes(Context)); 311this.Visit(method.GetType(Context)); 405this.Visit(nestedTypeReference.GetContainingType(Context)); 441this.Visit(parameterDefinition.GetAttributes(Context)); 447MetadataConstant? defaultValue = parameterDefinition.GetDefaultValue(Context); 461this.Visit(parameterDefinition.GetType(Context)); 476this.Visit(parameterTypeInformation.GetType(Context)); 485this.Visit(pointerTypeReference.GetTargetType(Context)); 492this.Visit(functionPointerTypeReference.Signature.GetType(Context)); 494foreach (var param in functionPointerTypeReference.Signature.GetParameters(Context)) 510this.Visit(propertyDefinition.GetAccessors(Context)); 568this.Visit(typeMember.GetAttributes(Context)); 577if (typeMemberReference.AsDefinition(Context) == null) 579this.Visit(typeMemberReference.GetAttributes(Context)); // In principle, references can have attributes that are distinct from the definitions they refer to.
PEWriter\ReferenceIndexer.cs (12)
30Visit(module.GetSourceAssemblyAttributes(Context.IsRefAssembly)); 33Visit(module.GetAssemblyReferences(Context)); 35Visit(module.GetTopLevelTypeDefinitions(Context)); 37foreach (var exportedType in module.GetExportedTypes(Context.Diagnostics)) 42Visit(module.GetResources(Context)); 44Visit(module.GetFiles(Context)); 51var definingUnit = MetadataWriter.GetDefiningUnitReference(exportedType, Context); 59definingAssembly = ((IModuleReference)definingUnit).GetContainingAssembly(Context); 60if (definingAssembly != null && !ReferenceEquals(definingAssembly, Context.Module.GetContainingAssembly(Context))) 108var body = method.GetBody(Context); 117VisitImports(scope.GetUsedNamespaces(Context));
PEWriter\ReferenceIndexerBase.cs (43)
35if (assemblyReference != Context.Module.GetContainingAssembly(Context)) 46this.Visit(customModifier.GetModifier(Context)); 53this.Visit(eventDefinition.GetType(Context)); 64IUnitReference definingUnit = MetadataWriter.GetDefiningUnitReference(fieldReference.GetContainingType(Context), Context); 65if (definingUnit != null && ReferenceEquals(definingUnit, Context.Module)) 72this.Visit(fieldReference.GetType(Context)); 87this.Visit(genericMethodInstanceReference.GetGenericArguments(Context)); 88this.Visit(genericMethodInstanceReference.GetGenericMethod(Context)); 100this.Visit(genericParameter.GetAttributes(Context)); 101this.VisitTypeReferencesThatNeedTokens(genericParameter.GetConstraints(Context)); 111ITypeReference containingType = nestedType.GetContainingType(Context); 116this.Visit(nestedType.GetContainingType(Context)); 120this.Visit(genericTypeInstanceReference.GetGenericType(Context)); 121this.Visit(genericTypeInstanceReference.GetGenericArguments(Context)); 156IUnitReference definingUnit = MetadataWriter.GetDefiningUnitReference(methodReference.GetContainingType(Context), Context); 157if (definingUnit != null && ReferenceEquals(definingUnit, Context.Module) && !methodReference.AcceptsExtraArguments) 176this.Visit(signature.GetType(Context)); 177this.Visit(signature.GetParameters(Context)); 188if (moduleReference != Context.Module) 207var unit = namespaceTypeReference.GetUnit(Context); 221assemblyReference = moduleReference.GetContainingAssembly(Context); 222if (assemblyReference != null && assemblyReference != Context.Module.GetContainingAssembly(Context)) 250this.Visit(propertyDefinition.GetType(Context)); 273this.Visit(typeDefinition.GetAttributes(Context)); 275var baseType = typeDefinition.GetBaseClass(Context); 283this.Visit(typeDefinition.GetExplicitImplementationOverrides(Context)); 289this.VisitTypeReferencesThatNeedTokens(typeDefinition.Interfaces(Context)); 301this.Visit(typeDefinition.GetEvents(Context)); 302this.Visit(typeDefinition.GetFields(Context)); 303this.Visit(typeDefinition.GetMethods(Context)); 304this.VisitNestedTypes(typeDefinition.GetNestedTypes(Context)); 305this.Visit(typeDefinition.GetProperties(Context)); 338this.Visit(typeMemberReference.GetContainingType(Context)); 350ITypeReference current = arrayTypeReference.GetElementType(Context); 362current = ((IArrayTypeReference)current).GetElementType(Context); 381ITypeReference current = pointerTypeReference.GetTargetType(Context); 393current = ((IPointerTypeReference)current).GetTargetType(Context); 442INestedTypeReference unspecializedNestedTypeReference = specializedNestedTypeReference.GetUnspecializedVersion(Context); 457this.Visit(nestedTypeReference.GetContainingType(Context));
PEWriter\TypeReferenceIndexer.cs (1)
29this.Visit(module.GetSourceAssemblyAttributes(Context.IsRefAssembly));