Class MetadataModule
- Namespace
- ICSharpCode.Decompiler.TypeSystem
- Assembly
- ICSharpCode.Decompiler.dll
Type system implementation for Metadata.PEFile.
public class MetadataModule : IModule, ISymbol, ICompilationProvider
- Inheritance
-
MetadataModule
- Implements
- Inherited Members
- Extension Methods
Properties
AssemblyName
Gets the assembly name (short name).
public string AssemblyName { get; }
Property Value
AssemblyVersion
Gets the assembly version.
public Version AssemblyVersion { get; }
Property Value
Compilation
Gets the parent compilation. This property never returns null.
public ICompilation Compilation { get; }
Property Value
FullAssemblyName
Gets the full assembly name (including public key token etc.)
public string FullAssemblyName { get; }
Property Value
IsMainModule
Gets whether this assembly is the main assembly of the compilation.
public bool IsMainModule { get; }
Property Value
PEFile
Gets the underlying metadata file. May return null, if the IAssembly was not created from a PE file.
public PEFile PEFile { get; }
Property Value
RootNamespace
public INamespace RootNamespace { get; }
Property Value
TopLevelTypeDefinitions
Gets all non-nested types in the assembly.
public IEnumerable<ITypeDefinition> TopLevelTypeDefinitions { get; }
Property Value
TypeDefinitions
Gets all types in the assembly, including nested types.
public IEnumerable<ITypeDefinition> TypeDefinitions { get; }
Property Value
TypeSystemOptions
public TypeSystemOptions TypeSystemOptions { get; }
Property Value
Methods
DecodeLocalSignature(StandaloneSignatureHandle, GenericContext)
public ImmutableArray<IType> DecodeLocalSignature(StandaloneSignatureHandle handle, GenericContext genericContext)
Parameters
handle
StandaloneSignatureHandlegenericContext
GenericContext
Returns
DecodeMethodSignature(StandaloneSignatureHandle, GenericContext)
public (SignatureHeader, FunctionPointerType) DecodeMethodSignature(StandaloneSignatureHandle handle, GenericContext genericContext)
Parameters
handle
StandaloneSignatureHandlegenericContext
GenericContext
Returns
GetAssemblyAttributes()
Gets the list of all assembly attributes in the project.
public IEnumerable<IAttribute> GetAssemblyAttributes()
Returns
GetDeclaringModule(TypeReferenceHandle)
public IModule GetDeclaringModule(TypeReferenceHandle handle)
Parameters
handle
TypeReferenceHandle
Returns
GetDefinition(EventDefinitionHandle)
public IEvent GetDefinition(EventDefinitionHandle handle)
Parameters
handle
EventDefinitionHandle
Returns
GetDefinition(FieldDefinitionHandle)
public IField GetDefinition(FieldDefinitionHandle handle)
Parameters
handle
FieldDefinitionHandle
Returns
GetDefinition(MethodDefinitionHandle)
public IMethod GetDefinition(MethodDefinitionHandle handle)
Parameters
handle
MethodDefinitionHandle
Returns
GetDefinition(PropertyDefinitionHandle)
public IProperty GetDefinition(PropertyDefinitionHandle handle)
Parameters
handle
PropertyDefinitionHandle
Returns
GetDefinition(TypeDefinitionHandle)
public ITypeDefinition GetDefinition(TypeDefinitionHandle handle)
Parameters
handle
TypeDefinitionHandle
Returns
GetModuleAttributes()
Gets the list of all module attributes in the project.
public IEnumerable<IAttribute> GetModuleAttributes()
Returns
GetTypeDefinition(TopLevelTypeName)
public ITypeDefinition GetTypeDefinition(TopLevelTypeName topLevelTypeName)
Parameters
topLevelTypeName
TopLevelTypeName
Returns
InternalsVisibleTo(IModule)
Gets whether the internals of this assembly are visible in the specified assembly.
public bool InternalsVisibleTo(IModule module)
Parameters
module
IModule
Returns
ResolveEntity(EntityHandle, GenericContext)
Resolves a symbol.
public IEntity ResolveEntity(EntityHandle entityHandle, GenericContext context = default)
Parameters
entityHandle
EntityHandlecontext
GenericContext
Returns
Remarks
- Types are resolved to their definition, as IType does not implement ISymbol.
- types without definition will resolve to
null
- use ResolveType() to properly resolve types
- types without definition will resolve to
- When resolving methods, varargs signatures are not expanded.
- use ResolveMethod() instead to get an IMethod instance suitable for call-sites
- May return specialized members, where generics are involved.
- Other types of handles that don't correspond to TS entities, will return
null
.
ResolveMethod(EntityHandle, GenericContext)
public IMethod ResolveMethod(EntityHandle methodReference, GenericContext context)
Parameters
methodReference
EntityHandlecontext
GenericContext
Returns
ResolveModule(AssemblyReferenceHandle)
public IModule ResolveModule(AssemblyReferenceHandle handle)
Parameters
handle
AssemblyReferenceHandle
Returns
ResolveModule(ModuleReferenceHandle)
public IModule ResolveModule(ModuleReferenceHandle handle)
Parameters
handle
ModuleReferenceHandle
Returns
ResolveType(EntityHandle, GenericContext, TypeSystemOptions, CustomAttributeHandleCollection?, Nullability)
public IType ResolveType(EntityHandle typeRefDefSpec, GenericContext context, TypeSystemOptions customOptions, CustomAttributeHandleCollection? typeAttributes = null, Nullability nullableContext = Nullability.Oblivious)
Parameters
typeRefDefSpec
EntityHandlecontext
GenericContextcustomOptions
TypeSystemOptionstypeAttributes
CustomAttributeHandleCollection?nullableContext
Nullability
Returns
ResolveType(EntityHandle, GenericContext, CustomAttributeHandleCollection?, Nullability)
public IType ResolveType(EntityHandle typeRefDefSpec, GenericContext context, CustomAttributeHandleCollection? typeAttributes = null, Nullability nullableContext = Nullability.Oblivious)
Parameters
typeRefDefSpec
EntityHandlecontext
GenericContexttypeAttributes
CustomAttributeHandleCollection?nullableContext
Nullability