PostSharp 6.6 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Extensibility Namespace / Message­Location Class / Message­Location Methods / Message­Location.​Of Method / Message­Location.​Of Method (Object)

MessageLocation.Of Method (Object)

Builds a MessageLocation from an object representing an element of code (Type, MethodInfo, ConstructorInfo, FieldInfo, IExpression, Assembly, ParameterInfo, EventInfo, PropertyInfo or, if you are using PostSharp SDK, any Declaration).

Namespace:  PostSharp.Extensibility
Assembly:  PostSharp (in PostSharp.dll) Version: 6.6.14.0 (6.6.14.0)
Syntax
C#
public static MessageLocation Of(
	Object codeElement
)

Parameters

codeElement
Type: System.Object
an object representing an element of code (Type, MethodInfo, ConstructorInfo, FieldInfo, Assembly, ParameterInfo, EventInfo, PropertyInfo, IExpression or, if you are using PostSharp SDK, any Declaration.

Return Value

Type: MessageLocation
A MessageLocation representing codeElement.
Remarks

If codeElement is null or cannot mapped to a location of code, this method silently returns Unknown.

See Also