2using System.Collections.Generic;
3using System.Diagnostics;
5using System.Reflection;
6using System.Reflection.Metadata.Ecma335;
17 const BindingFlags DefaultBindingFlags = BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance;
19 readonly
Type _underlyingType;
30 int _propertiesBaseRow;
42 Type[]? _genericParametersSource;
45 ReaderWriterLockSlim? _genericTypesLock;
54 base(context, module, null, underlyingType)
56 Debug.Assert(module.UnderlyingModule == underlyingType.Module);
57 _underlyingType = underlyingType ??
throw new ArgumentNullException(nameof(underlyingType));
75 internal ReflectionConstructorSymbol GetOrCreateConstructorSymbol(
ConstructorInfo ctor)
77 return (ReflectionConstructorSymbol)GetOrCreateMethodBaseSymbol(ctor);
85 internal ReflectionMethodBaseSymbol GetOrCreateMethodBaseSymbol(
MethodBase method)
88 throw new ArgumentNullException(nameof(method));
90 Debug.Assert(method.DeclaringType == _underlyingType);
92 var hnd = MetadataTokens.MethodDefinitionHandle(method.MetadataToken);
93 var row = MetadataTokens.GetRowNumber(hnd);
96 if (_methodsSource ==
null)
98 Interlocked.CompareExchange(
ref _methodsSource, _underlyingType.GetConstructors(DefaultBindingFlags).Cast<
MethodBase>().Concat(_underlyingType.GetMethods(DefaultBindingFlags)).OrderBy(i => i.MetadataToken).ToArray(),
null);
99 _methodsBaseRow = _methodsSource.Length != 0 ? MetadataTokens.GetRowNumber(MetadataTokens.MethodDefinitionHandle(_methodsSource[0].MetadataToken)) : 0;
103 if (_methods ==
null)
104 Interlocked.CompareExchange(
ref _methods,
new ReflectionMethodBaseSymbol?[_methodsSource.Length],
null);
107 var idx = row - _methodsBaseRow;
108 Debug.Assert(idx >= 0);
109 Debug.Assert(idx < _methodsSource.Length);
112 if (_methods.Length < idx)
113 throw new IndexOutOfRangeException();
116 ref var rec =
ref _methods[idx];
122 Interlocked.CompareExchange(
ref rec,
new ReflectionConstructorSymbol(
Context, ContainingModule,
this, c),
null);
125 Interlocked.CompareExchange(
ref rec,
new ReflectionMethodSymbol(
Context, ContainingModule,
this, m),
null);
131 if (rec is not ReflectionMethodBaseSymbol sym)
132 throw new InvalidOperationException();
143 internal ReflectionFieldSymbol GetOrCreateFieldSymbol(
FieldInfo field)
146 throw new ArgumentNullException(nameof(field));
148 Debug.Assert(field.DeclaringType == _underlyingType);
150 var hnd = MetadataTokens.FieldDefinitionHandle(field.MetadataToken);
151 var row = MetadataTokens.GetRowNumber(hnd);
154 if (_fieldsSource ==
null)
156 Interlocked.CompareExchange(
ref _fieldsSource, _underlyingType.GetFields(DefaultBindingFlags).OrderBy(i => i.MetadataToken).ToArray(),
null);
157 _fieldsBaseRow = _fieldsSource.Length != 0 ? MetadataTokens.GetRowNumber(MetadataTokens.MethodDefinitionHandle(_fieldsSource[0].MetadataToken)) : 0;
162 Interlocked.CompareExchange(
ref _fields,
new ReflectionFieldSymbol?[_fieldsSource.Length],
null);
165 var idx = row - _fieldsBaseRow;
166 Debug.Assert(idx >= 0);
167 Debug.Assert(idx < _fieldsSource.Length);
170 if (_fields.Length < idx)
171 throw new IndexOutOfRangeException();
174 ref var rec =
ref _fields[idx];
179 if (rec is not ReflectionFieldSymbol sym)
180 throw new InvalidOperationException();
191 internal ReflectionPropertySymbol GetOrCreatePropertySymbol(
PropertyInfo property)
193 if (property is
null)
194 throw new ArgumentNullException(nameof(property));
196 Debug.Assert(property.DeclaringType == _underlyingType);
198 var hnd = MetadataTokens.PropertyDefinitionHandle(property.MetadataToken);
199 var row = MetadataTokens.GetRowNumber(hnd);
202 if (_propertiesSource ==
null)
204 Interlocked.CompareExchange(
ref _propertiesSource, _underlyingType.GetProperties(DefaultBindingFlags).OrderBy(i => i.MetadataToken).ToArray(),
null);
205 _propertiesBaseRow = _propertiesSource.Length != 0 ? MetadataTokens.GetRowNumber(MetadataTokens.MethodDefinitionHandle(_propertiesSource[0].MetadataToken)) : 0;
209 if (_properties ==
null)
210 Interlocked.CompareExchange(
ref _properties,
new ReflectionPropertySymbol?[_propertiesSource.Length],
null);
213 var idx = row - _propertiesBaseRow;
214 Debug.Assert(idx >= 0);
215 Debug.Assert(idx < _propertiesSource.Length);
218 if (_properties.Length < idx)
219 throw new IndexOutOfRangeException();
222 ref var rec =
ref _properties[idx];
227 if (rec is not ReflectionPropertySymbol sym)
228 throw new InvalidOperationException();
239 internal ReflectionEventSymbol GetOrCreateEventSymbol(
EventInfo @event)
242 throw new ArgumentNullException(nameof(@event));
244 Debug.Assert(@event.DeclaringType == _underlyingType);
246 var hnd = MetadataTokens.PropertyDefinitionHandle(@event.MetadataToken);
247 var row = MetadataTokens.GetRowNumber(hnd);
250 if (_eventsSource ==
null)
252 Interlocked.CompareExchange(
ref _eventsSource, _underlyingType.GetEvents(DefaultBindingFlags).OrderBy(i => i.MetadataToken).ToArray(),
null);
253 _eventsBaseRow = _eventsSource.Length != 0 ? MetadataTokens.GetRowNumber(MetadataTokens.EventDefinitionHandle(_eventsSource[0].MetadataToken)) : 0;
258 Interlocked.CompareExchange(
ref _events,
new ReflectionEventSymbol?[_eventsSource.Length],
null);
261 var idx = row - _eventsBaseRow;
262 Debug.Assert(idx >= 0);
263 Debug.Assert(idx < _eventsSource.Length);
266 if (_events.Length < idx)
267 throw new IndexOutOfRangeException();
270 ref var rec =
ref _events[idx];
275 if (rec is not ReflectionEventSymbol sym)
276 throw new InvalidOperationException();
289 if (genericTypeParameterType is
null)
290 throw new ArgumentNullException(nameof(genericTypeParameterType));
292 Debug.Assert(genericTypeParameterType.DeclaringType == _underlyingType);
295 if (_genericParametersSource ==
null)
296 Interlocked.CompareExchange(
ref _genericParametersSource, _underlyingType.GetGenericArguments(),
null);
297 if (_genericParameters ==
null)
301 var idx = genericTypeParameterType.GenericParameterPosition;
304 if (_genericParameters.Length < idx)
305 throw new IndexOutOfRangeException();
308 ref var rec =
ref _genericParameters[idx];
314 throw new InvalidOperationException();
327 if (genericTypeArguments is
null)
328 throw new ArgumentNullException(nameof(genericTypeArguments));
330 if (_underlyingType.IsGenericTypeDefinition ==
false)
331 throw new InvalidOperationException();
334 if (_genericParametersSource ==
null)
335 Interlocked.CompareExchange(
ref _genericParametersSource, _underlyingType.GetGenericArguments(),
null);
336 if (_genericParametersSource.Length != genericTypeArguments.Length)
337 throw new InvalidOperationException();
340 if (_genericTypes ==
null)
342 if (_genericTypesLock ==
null)
347 _genericTypesLock.EnterUpgradeableReadLock();
350 foreach (var i
in _genericTypes)
351 if (i.Arguments.SequenceEqual(genericTypeArguments))
356 _genericTypesLock.EnterWriteLock();
360 _genericTypes.Add((genericTypeArguments, sym));
365 _genericTypesLock.ExitWriteLock();
370 _genericTypesLock.ExitUpgradeableReadLock();
381 if (type == _underlyingType)
384 return base.ResolveTypeSymbol(type);
392 protected internal override ReflectionConstructorSymbol ResolveConstructorSymbol(
ConstructorInfo ctor)
394 if (ctor.DeclaringType == _underlyingType)
395 return GetOrCreateConstructorSymbol(ctor);
397 return base.ResolveConstructorSymbol(ctor);
405 protected internal override ReflectionMethodSymbol ResolveMethodSymbol(
MethodInfo method)
407 if (method.DeclaringType == _underlyingType)
408 return GetOrCreateMethodSymbol(method);
410 return base.ResolveMethodSymbol(method);
418 protected internal override ReflectionFieldSymbol ResolveFieldSymbol(
FieldInfo field)
420 if (field.DeclaringType == _underlyingType)
421 return GetOrCreateFieldSymbol(field);
423 return base.ResolveFieldSymbol(field);
431 protected internal override ReflectionPropertySymbol ResolvePropertySymbol(
PropertyInfo property)
433 if (property.DeclaringType == _underlyingType)
434 return GetOrCreatePropertySymbol(property);
436 return base.ResolvePropertySymbol(property);
444 protected internal override ReflectionEventSymbol ResolveEventSymbol(
EventInfo @event)
446 if (@event.DeclaringType == _underlyingType)
447 return GetOrCreateEventSymbol(@event);
449 return base.ResolveEventSymbol(@event);
455 internal Type UnderlyingType => _underlyingType;
461 public TypeAttributes
Attributes => _underlyingType.Attributes;
463 public ITypeSymbol?
BaseType => _underlyingType.BaseType !=
null ? ResolveTypeSymbol(_underlyingType.BaseType) : null;
469 public string?
FullName => _underlyingType.FullName;
481 public bool IsArray => _underlyingType.IsArray;
485 public bool IsByRef => _underlyingType.IsByRef;
487 public bool IsClass => _underlyingType.IsClass;
491 public bool IsEnum => _underlyingType.IsEnum;
529#pragma warning disable SYSLIB0050
531#pragma warning restore SYSLIB0050
543 return _underlyingType.GetArrayRank();
548 return _underlyingType.GetConstructor(bindingAttr, binder:
null, UnpackTypeSymbols(types), modifiers:
null) is
ConstructorInfo ctor ? ResolveConstructorSymbol(ctor) :
null;
553 return _underlyingType.GetConstructor(UnpackTypeSymbols(types)) is
ConstructorInfo ctor ? ResolveConstructorSymbol(ctor) :
null;
558 return ResolveConstructorSymbols(_underlyingType.GetConstructors());
563 return ResolveConstructorSymbols(_underlyingType.GetConstructors(bindingAttr));
568 return ResolveMemberSymbols(_underlyingType.GetDefaultMembers());
578 return _underlyingType.GetEnumName(value);
583 return _underlyingType.GetEnumNames();
588 return ResolveTypeSymbol(_underlyingType.GetEnumUnderlyingType());
593 return _underlyingType.GetEnumValues();
598 throw new NotImplementedException();
603 return _underlyingType.GetEvent(name) is { } f ? ResolveEventSymbol(f) :
null;
608 return ResolveEventSymbols(_underlyingType.GetEvents());
613 return ResolveEventSymbols(_underlyingType.GetEvents(bindingAttr));
618 return _underlyingType.GetField(name) is
FieldInfo f ? ResolveFieldSymbol(f) :
null;
623 return _underlyingType.GetField(name, bindingAttr) is
FieldInfo f ? ResolveFieldSymbol(f) :
null;
628 return ResolveFieldSymbols(_underlyingType.GetFields());
633 return ResolveFieldSymbols(_underlyingType.GetFields(bindingAttr));
638 return ResolveTypeSymbols(_underlyingType.GetGenericArguments());
643 return ResolveTypeSymbols(_underlyingType.GetGenericParameterConstraints());
648 return ResolveTypeSymbol(_underlyingType.GetGenericTypeDefinition());
653 return _underlyingType.
GetInterface(name) is { } i ? ResolveTypeSymbol(i) :
null;
658 return _underlyingType.
GetInterface(name, ignoreCase) is { } i ? ResolveTypeSymbol(i) :
null;
663 throw new NotImplementedException();
668 return ResolveTypeSymbols(_underlyingType.GetInterfaces());
673 return ResolveMemberSymbols(_underlyingType.GetMember(name));
678 return ResolveMemberSymbols(_underlyingType.GetMember(name, bindingAttr));
683 return ResolveMemberSymbols(_underlyingType.GetMember(name, type, bindingAttr));
688 return ResolveMemberSymbols(_underlyingType.GetMembers(bindingAttr));
693 return ResolveMemberSymbols(_underlyingType.GetMembers());
698 return _underlyingType.GetMethod(name, bindingAttr) is { } m ? ResolveMethodSymbol(m) :
null;
703 return _underlyingType.GetMethod(name, UnpackTypeSymbols(types)) is { } m ? ResolveMethodSymbol(m) :
null;
708 return _underlyingType.GetMethod(name, bindingAttr,
null, UnpackTypeSymbols(types),
null) is { } m ? ResolveMethodSymbol(m) :
null;
713 return _underlyingType.GetMethod(name) is { } m ? ResolveMethodSymbol(m) :
null;
718 return ResolveMethodSymbols(_underlyingType.GetMethods(bindingAttr));
723 return ResolveMethodSymbols(_underlyingType.GetMethods());
728 return _underlyingType.
GetNestedType(name) is
Type t ? ResolveTypeSymbol(t) :
null;
733 return _underlyingType.
GetNestedType(name, bindingAttr) is
Type t ? ResolveTypeSymbol(t) :
null;
738 return ResolveTypeSymbols(_underlyingType.GetNestedTypes());
743 return ResolveTypeSymbols(_underlyingType.GetNestedTypes(bindingAttr));
748 return ResolvePropertySymbols(_underlyingType.GetProperties());
753 return ResolvePropertySymbols(_underlyingType.GetProperties(bindingAttr));
758 return _underlyingType.GetProperty(name, UnpackTypeSymbols(types)) is { } p ? ResolvePropertySymbol(p) :
null;
763 var _returnType = returnType !=
null ? ((
ReflectionTypeSymbol)returnType).UnderlyingType :
null;
764 return _underlyingType.GetProperty(name, _returnType, UnpackTypeSymbols(types)) is { } p ? ResolvePropertySymbol(p) :
null;
769 return _underlyingType.GetProperty(name, bindingAttr) is { } p ? ResolvePropertySymbol(p) :
null;
774 return _underlyingType.GetProperty(name) is { } p ? ResolvePropertySymbol(p) :
null;
779 var _returnType = returnType !=
null ? ((
ReflectionTypeSymbol)returnType).UnderlyingType :
null;
781 return _underlyingType.GetProperty(name, _returnType) is { } p ? ResolvePropertySymbol(p) :
null;
786 return _underlyingType.IsAssignableFrom(c !=
null ? ((
ReflectionTypeSymbol)c).UnderlyingType :
null);
791 return _underlyingType.IsEnumDefined(value);
801 if (_asSZArray ==
null)
812 if (_asArray ==
null)
815 ref var asArray =
ref _asArray[rank];
824 if (_asByRef ==
null)
832 throw new NotImplementedException();
837 if (_asPointer ==
null)
System.Threading.Interlocked Interlocked
IKVM.Reflection.Type Type
IKVM.Reflection.Assembly Assembly
IKVM.Reflection.ConstructorInfo ConstructorInfo
IKVM.Reflection.EventInfo EventInfo
IKVM.Reflection.FieldInfo FieldInfo
IKVM.Reflection.PropertyInfo PropertyInfo
IKVM.Reflection.MethodInfo MethodInfo
IKVM.Reflection.MethodBase MethodBase
Obtains information about the attributes of a member and provides access to member metadata.
Implementation of IModuleSymbol derived from System.Reflection.
Holds references to symbols derived from System.Reflection.
ReflectionAssemblySymbol GetOrCreateAssemblySymbol(Assembly assembly)
Gets or creates a ReflectionAssemblySymbol for the specified Assembly.
ReflectionSymbolContext Context
Gets the associated ReflectionSymbolContext.
TypeAttributes Attributes
Gets the attributes associated with the .
bool IsEnum
Gets a value indicating whether the current ITypeSymbol represents an enumeration.
IConstructorSymbol? GetConstructor(BindingFlags bindingAttr, ITypeSymbol[] types)
Searches for a constructor whose parameters match the specified argument types, using the specified b...
ITypeSymbol? GetNestedType(string name, BindingFlags bindingAttr)
When overridden in a derived class, searches for the specified nested type, using the specified bindi...
IPropertySymbol[] GetProperties(BindingFlags bindingAttr)
When overridden in a derived class, searches for the properties of the current ITypeSymbol,...
bool IsSubclassOf(ITypeSymbol c)
Determines whether the current ITypeSymbol derives from the specified ITypeSymbol.
string? AssemblyQualifiedName
Gets the assembly-qualified name of the type, which includes the name of the assembly from which this...
ITypeSymbol[] GetNestedTypes(BindingFlags bindingAttr)
When overridden in a derived class, searches for the types nested in the current ITypeSymbol,...
bool IsExplicitLayout
Gets a value indicating whether the fields of the current type are laid out at explicitly specified o...
bool IsNestedFamily
Gets a value indicating whether the ITypeSymbol is nested and visible only within its own family.
bool IsGenericType
Gets a value indicating whether the current type is a generic type.
IMethodSymbol? GetMethod(string name, BindingFlags bindingAttr)
Searches for the specified method, using the specified binding constraints.
bool IsAutoLayout
Gets a value indicating whether the fields of the current type are laid out automatically by the comm...
ITypeSymbol GetEnumUnderlyingType()
Returns the underlying type of the current enumeration type.
string? FullName
Gets the fully qualified name of the type, including its namespace but not its assembly.
bool IsClass
Gets a value indicating whether the ITypeSymbol is a class or a delegate; that is,...
IPropertySymbol? GetProperty(string name, ITypeSymbol? returnType)
Searches for the public property with the specified name and return type.
bool IsNestedPublic
Gets a value indicating whether a class is nested and declared public.
bool IsAssignableFrom(ITypeSymbol? c)
Determines whether an instance of a specified type c can be assigned to a variable of the current typ...
IPropertySymbol? GetProperty(string name, BindingFlags bindingAttr)
Searches for the specified property, using the specified binding constraints.
bool IsNotPublic
Gets a value indicating whether the ITypeSymbol is not declared public.
bool IsNestedFamORAssem
Gets a value indicating whether the ITypeSymbol is nested and visible only to classes that belong to ...
IMemberSymbol[] GetMember(string name)
Searches for the public members with the specified name.
IConstructorSymbol[] GetConstructors(BindingFlags bindingAttr)
When overridden in a derived class, searches for the constructors defined for the current ITypeSymbol...
IConstructorSymbol? TypeInitializer
Gets the initializer for the type.
IMethodSymbol[] GetMethods()
Returns all the public methods of the current ITypeSymbol.
IPropertySymbol? GetProperty(string name)
Searches for the public property with the specified name.
string[] GetEnumNames()
Returns the names of the members of the current enumeration type.
ITypeSymbol[] GetGenericParameterConstraints()
Returns an array of ITypeSymbol objects that represent the constraints on the current generic type pa...
ITypeSymbol[] GetInterfaces()
When overridden in a derived class, gets all the interfaces implemented or inherited by the current I...
IFieldSymbol? GetField(string name)
Searches for the public field with the specified name.
ITypeSymbol[] GenericTypeArguments
Gets an array of the generic type arguments for this type.
ITypeSymbol MakePointerType()
Returns a ITypeSymbol object that represents a pointer to the current type.
bool IsAbstract
Gets a value indicating whether the ITypeSymbol is abstract and must be overridden.
bool IsPrimitive
Gets a value indicating whether the ITypeSymbol is one of the primitive types.
bool IsNestedPrivate
Gets a value indicating whether the ITypeSymbol is nested and declared private.
bool IsInterface
Gets a value indicating whether the ITypeSymbol is an interface; that is, not a class or a value type...
ReflectionTypeSymbol(ReflectionSymbolContext context, ReflectionModuleSymbol module, Type underlyingType)
Initializes a new instance.
IFieldSymbol[] GetFields(BindingFlags bindingAttr)
When overridden in a derived class, searches for the fields defined for the current ITypeSymbol,...
bool IsGenericParameter
Gets a value indicating whether the current ITypeSymbol represents a type parameter in the definition...
IConstructorSymbol[] GetConstructors()
Returns all the public constructors defined for the current ITypeSymbol.
ITypeSymbol? GetNestedType(string name)
Searches for the public nested type with the specified name.
ITypeSymbol GetGenericTypeDefinition()
Returns a ITypeSymbol object that represents a generic type definition from which the current generic...
IMethodSymbol? GetMethod(string name, BindingFlags bindingAttr, ITypeSymbol[] types)
Searches for the specified method whose parameters match the specified argument types,...
IMethodSymbol? GetMethod(string name, ITypeSymbol[] types)
Searches for the specified public method whose parameters match the specified argument types.
bool IsValueType
Gets a value indicating whether the ITypeSymbol is a value type.
GenericParameterAttributes GenericParameterAttributes
Gets a combination of GenericParameterAttributes flags that describe the covariance and special const...
ITypeSymbol MakeArrayType()
Returns a ITypeSymbol object representing a one-dimensional array of the current type,...
ITypeSymbol? GetInterface(string name)
Searches for the interface with the specified name.
IMemberSymbol[] GetMembers()
Returns all the public members of the current ITypeSymbol.
InterfaceMapping GetInterfaceMap(ITypeSymbol interfaceType)
Returns an interface mapping for the specified interface type.
string? GetEnumName(object value)
Returns the name of the constant that has the specified value, for the current enumeration type.
ITypeSymbol MakeArrayType(int rank)
Returns a ITypeSymbol object representing an array of the current type, with the specified number of ...
bool IsEnumDefined(object value)
Returns a value that indicates whether the specified value exists in the current enumeration type.
bool IsConstructedGenericType
Gets a value that indicates whether this object represents a constructed generic type....
IEventSymbol? GetEvent(string name)
Returns the EventInfo object representing the specified public event.
ITypeSymbol[] GetNestedTypes()
Returns the public types nested in the current ITypeSymbol.
IFieldSymbol? GetField(string name, BindingFlags bindingAttr)
Searches for the specified field, using the specified binding constraints.
bool IsPointer
Gets a value indicating whether the ITypeSymbol is a pointer.
ITypeSymbol[] GetGenericArguments()
Returns an array of ITypeSymbol objects that represent the type arguments of a closed generic type or...
bool IsSealed
Gets a value indicating whether the ITypeSymbol is declared sealed.
IPropertySymbol? GetProperty(string name, ITypeSymbol[] types)
Searches for the specified public property whose parameters match the specified argument types.
bool IsVisible
Gets a value indicating whether the ITypeSymbol can be accessed by code outside the assembly.
IMemberSymbol[] GetDefaultMembers()
Searches for the members defined for the current ITypeSymbol whose DefaultMemberAttribute is set.
IMemberSymbol[] GetMembers(BindingFlags bindingAttr)
When overridden in a derived class, searches for the members defined for the current ITypeSymbol,...
IMemberSymbol[] GetMember(string name, BindingFlags bindingAttr)
Searches for the specified members, using the specified binding constraints.
IConstructorSymbol? GetConstructor(ITypeSymbol[] types)
Searches for a public instance constructor whose parameters match the types in the specified array.
IMethodSymbol[] GetMethods(BindingFlags bindingAttr)
When overridden in a derived class, searches for the methods defined for the current ITypeSymbol,...
bool ContainsGenericParameters
Gets a value indicating whether the current ITypeSymbol object has type parameters that have not been...
IEventSymbol[] GetEvents(BindingFlags bindingAttr)
When overridden in a derived class, searches for events that are declared or inherited by the current...
bool IsLayoutSequential
Gets a value indicating whether the fields of the current type are laid out sequentially,...
IPropertySymbol? GetProperty(string name, ITypeSymbol? returnType, ITypeSymbol[] types)
Searches for the specified public property whose parameters match the specified argument types.
bool HasElementType
Gets a value indicating whether the current ITypeSymbol encompasses or refers to another type; that i...
int GenericParameterPosition
Gets the position of the type parameter in the type parameter list of the generic type or method that...
bool IsByRef
Gets a value indicating whether the ITypeSymbol is passed by reference.
IMethodSymbol? GetMethod(string name)
Searches for the public method with the specified name.
bool IsNestedFamANDAssem
Gets a value indicating whether the ITypeSymbol is nested and visible only to classes that belong to ...
int GetArrayRank()
Gets the number of dimensions in an array.
bool IsNested
Gets a value indicating whether the current ITypeSymbol object represents a type whose definition is ...
ITypeSymbol? BaseType
Gets the type from which the current ITypeSymbol directly inherits.
IEventSymbol? GetEvent(string name, BindingFlags bindingAttr)
When overridden in a derived class, returns the EventInfo object representing the specified event,...
bool IsNestedAssembly
Gets a value indicating whether the ITypeSymbol is nested and visible only within its own assembly.
ITypeSymbol? GetInterface(string name, bool ignoreCase)
When overridden in a derived class, searches for the specified interface, specifying whether to do a ...
IMethodBaseSymbol? DeclaringMethod
Gets a IMethodBaseSymbol that represents the declaring method, if the current ITypeSymbol represents ...
bool IsPublic
Gets a value indicating whether the ITypeSymbol is declared public.
IMemberSymbol[] GetMember(string name, MemberTypes type, BindingFlags bindingAttr)
Searches for the specified members of the specified member type, using the specified binding constrai...
ITypeSymbol MakeGenericType(params ITypeSymbol[] typeArguments)
Substitutes the elements of an array of types for the type parameters of the current generic type def...
bool IsSerializable
Gets a value indicating whether the ITypeSymbol is binary serializable.
bool IsArray
Gets a value that indicates whether the type is an array.
IFieldSymbol[] GetFields()
Returns all the public fields of the current ITypeSymbol.
IPropertySymbol[] GetProperties()
Returns all the public properties of the current ITypeSymbol.
ITypeSymbol MakeByRefType()
Returns a ITypeSymbol object that represents the current type when passed as a ref parameter (ByRef p...
bool IsGenericTypeDefinition
ITypeSymbol? GetElementType()
When overridden in a derived class, returns the ITypeSymbol of the object encompassed or referred to ...
string? Namespace
Gets the namespace of the ITypeSymbol.
IEventSymbol[] GetEvents()
Returns all the public events that are declared or inherited by the current ITypeSymbol.
Represents an assembly, which is a reusable, versionable, and self-describing building block of a com...
Discovers the attributes of a class constructor and provides access to constructor metadata.
Discovers the attributes of an event and provides access to event metadata.
Discovers the attributes of a field and provides access to field metadata.
Obtains information about the attributes of a member and provides access to member metadata.
Provides information about methods and constructors.
Discovers the attributes of a method and provides access to method metadata.
Discovers the attributes of a property and provides access to property metadata.
Represents type declarations: class types, interface types, array types, value types,...
ITypeSymbol? GetNestedType(string name)
Searches for the public nested type with the specified name.
ITypeSymbol? GetElementType()
When overridden in a derived class, returns the ITypeSymbol of the object encompassed or referred to ...
ITypeSymbol? GetInterface(string name)
Searches for the interface with the specified name.