1 instantiation of TypeDefinitionEntity
ILAssembler (1)
EntityRegistry.cs (1)
620return GetOrCreateEntity((containingType, @namespace, name), TableIndex.TypeDef, _seenTypeDefs, (key) => new(key.Item1, key.Item2, key.Item3), onCreateType);
43 references to TypeDefinitionEntity
ILAssembler (43)
EntityRegistry.cs (33)
18private readonly Dictionary<(TypeDefinitionEntity? ContainingType, string Namespace, string Name), TypeDefinitionEntity> _seenTypeDefs = new(); 108foreach (TypeDefinitionEntity type in GetSeenEntities(TableIndex.TypeDef)) 192TypeDefinitionEntity type = (TypeDefinitionEntity)GetSeenEntities(TableIndex.TypeDef)[i]; 198GetFieldHandleForList(type.Fields, GetSeenEntities(TableIndex.TypeDef), type => ((TypeDefinitionEntity)type).Fields, i), 199GetMethodHandleForList(type.Methods, GetSeenEntities(TableIndex.TypeDef), type => ((TypeDefinitionEntity)type).Methods, i)); 203GetEventHandleForList(type.Events, GetSeenEntities(TableIndex.TypeDef), type => ((TypeDefinitionEntity)type).Events, i)); 206GetPropertyHandleForList(type.Properties, GetSeenEntities(TableIndex.TypeDef), type => ((TypeDefinitionEntity)type).Properties, i)); 556public TypeDefinitionEntity ModuleType { get; } 618public TypeDefinitionEntity GetOrCreateTypeDefinition(TypeDefinitionEntity? containingType, string @namespace, string name, Action<TypeDefinitionEntity> onCreateType) 623public TypeDefinitionEntity? FindTypeDefinition(TypeDefinitionEntity? containingType, string @namespace, string @name) 625if (_seenTypeDefs.TryGetValue((containingType, @namespace, name), out var typeDef)) 722public static MethodDefinitionEntity CreateUnrecordedMethodDefinition(TypeDefinitionEntity containingType, string name) 750public static FieldDefinitionEntity? CreateUnrecordedFieldDefinition(FieldAttributes attributes, TypeDefinitionEntity containingType, string name, BlobBuilder signature) 770public static InterfaceImplementationEntity CreateUnrecordedInterfaceImplementation(TypeDefinitionEntity implementingType, TypeEntity interfaceType) 964var typeDef = (TypeDefinitionEntity)GetSeenEntities(TableIndex.TypeDef)[MetadataTokens.GetRowNumber(type.Handle) - 1]; 1181public TypeDefinitionEntity(TypeDefinitionEntity? containingType, string @namespace, string name) 1189static string CreateReflectionNotation(TypeDefinitionEntity typeDefinition) 1192Stack<TypeDefinitionEntity> containingTypes = new(); 1193for (TypeDefinitionEntity? containingType = typeDefinition; containingType is not null; containingType = containingType.ContainingType) 1199TypeDefinitionEntity containingType = containingTypes.Pop(); 1211public TypeDefinitionEntity? ContainingType { get; } 1282public sealed class MethodDefinitionEntity(TypeDefinitionEntity containingType, string name) : EntityBase, IHasHandle 1284public TypeDefinitionEntity ContainingType { get; } = containingType; 1412public sealed class FieldDefinitionEntity(FieldAttributes attributes, TypeDefinitionEntity type, string name, BlobBuilder signature) : EntityBase 1415public TypeDefinitionEntity ContainingType { get; } = type; 1430public sealed class InterfaceImplementationEntity(TypeDefinitionEntity type, TypeEntity interfaceType) : EntityBase 1432public TypeDefinitionEntity Type { get; } = type;
GrammarVisitor.cs (10)
1041var currentType = _currentTypeDefinition.PeekOrDefault(); 1057var currentType = _currentTypeDefinition.PeekOrDefault(); 1071var currentType = _currentTypeDefinition.PeekOrDefault(); 1089public GrammarResult.Literal<EntityRegistry.TypeDefinitionEntity> VisitClassHead(CILParser.ClassHeadContext context) 1119var typeDefinition = _entityRegistry.GetOrCreateTypeDefinition( 1250var thisType = _currentTypeDefinition.Peek(); 1275var nesterType = _currentTypeDefinition.Peek().ContainingType!; 1335EntityRegistry.TypeDefinitionEntity? typeDef = null; 1707private readonly Stack<EntityRegistry.TypeDefinitionEntity> _currentTypeDefinition = new(); 3888var containingType = _currentTypeDefinition.PeekOrDefault() ?? _entityRegistry.ModuleType;