PostSharp6.3/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.3.9.0 (6.3.9.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
[!:ReflectionSearchOptions.UseReflectionWrappers] or None.

Return Value

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

Note Note

Note Note
This feature is available only at build time.

See Also