Open sandboxFocus

Method GetClosestMemberOrNamedType

GetClosestMemberOrNamedType(IDeclaration)

Gets the declaring IMemberOrNamedType of a given declaration if the declaration if not an IMemberOrNamedType, or the IMemberOrNamedType itself if the given declaration is itself an IMemberOrNamedType.

Declaration
public static IMemberOrNamedType? GetClosestMemberOrNamedType(this IDeclaration declaration)
Parameters
Type Name Description
IDeclaration declaration

The declaration.

Returns
Type Description
IMemberOrNamedType

The closest member or named type, or null if none is found.