PostSharp 6.5 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Reflection Namespace / Reflection­Search Class / Reflection­Search Methods / Reflection­Search.​Get­Declarations­Used­By­Method Method / Reflection­Search.​Get­Declarations­Used­By­Method Method (Method­Base, Reflection­Search­Options)

ReflectionSearch.GetDeclarationsUsedByMethod Method (MethodBase, ReflectionSearchOptions)

Gets all declarations (Type, FieldInfo, MethodInfo or ConstructorInfo) used by the body of a given method or constructor and specifies additional options.

Namespace:  PostSharp.Reflection
Assembly:  PostSharp (in PostSharp.dll) Version: 6.5.19.0 (6.5.19.0)
Syntax
C#
public static MethodUsageCodeReference[] GetDeclarationsUsedByMethod(
	MethodBase method,
	ReflectionSearchOptions options
)

Parameters

method
Type: System.Reflection.MethodBase
A MethodInfo or ConstructorInfo.
options
Type: PostSharp.Reflection.ReflectionSearchOptions
This parameter has no effect and is kept only for backwards compatibility.

Return Value

Type: MethodUsageCodeReference[]
An array of MethodUsageCodeReference containing one item for each declaration used by the body of method.
Remarks

Note Note
This feature is available only at build time.
See Also