Class IdStringProvider
- Namespace
- ICSharpCode.Decompiler.Documentation
- Assembly
- ICSharpCode.Decompiler.dll
Provides ID strings for entities. (C# 4.0 spec, §A.3.1) ID strings are used to identify members in XML documentation files.
public static class IdStringProvider
- Inheritance
-
IdStringProvider
- Inherited Members
Methods
FindEntity(string, ITypeResolveContext)
Finds the entity in the given type resolve context.
public static IEntity FindEntity(string idString, ITypeResolveContext context)
Parameters
idString
stringID string of the entity.
context
ITypeResolveContextType resolve context
Returns
- IEntity
Returns the entity, or null if it is not found.
Exceptions
- ReflectionNameParseException
The syntax of the ID string is invalid
GetIdString(IEntity)
Gets the ID string (C# 4.0 spec, §A.3.1) for the specified entity.
public static string GetIdString(this IEntity entity)
Parameters
entity
IEntity
Returns
GetTypeName(IType)
public static string GetTypeName(IType type)
Parameters
type
IType
Returns
ParseMemberIdString(string)
Parse the ID string into a member reference.
public static IMemberReference ParseMemberIdString(string memberIdString)
Parameters
memberIdString
stringThe ID string representing the member (with "M:", "F:", "P:" or "E:" prefix).
Returns
- IMemberReference
A member reference that represents the ID string.
Remarks
The member reference will look in CurrentModule first, and if the member is not found there, it will look in all other assemblies of the compilation.
Exceptions
- ReflectionNameParseException
The syntax of the ID string is invalid
ParseTypeName(string)
Parse the ID string type name into a type reference.
public static ITypeReference ParseTypeName(string typeName)
Parameters
typeName
stringThe ID string representing the type (the "T:" prefix is optional).
Returns
- ITypeReference
A type reference that represents the ID string.
Remarks
The type reference will look in CurrentModule first, and if the type is not found there, it will look in all other assemblies of the compilation.
If the type is open (contains type parameters '`0' or '``0'), an ITypeResolveContext with the appropriate CurrentTypeDefinition/CurrentMember is required to resolve the reference to the ITypeParameter.
Exceptions
- ReflectionNameParseException
The syntax of the ID string is invalid