PostSharpAPI ReferencePost­Sharp.​ExtensibilityMessage­LocationOf
Open sandboxFocus

MessageLocation.Of Method

Of(SymbolSequencePoint)

Declaration
public static MessageLocation Of(SymbolSequencePoint symbolSequencePoint)
Parameters
Type Name Description
SymbolSequencePoint symbolSequencePoint

A SymbolSequencePoint.

Returns
Type Description
MessageLocation

A MessageLocation corresponding to symbolSequencePoint.

Of(Object)

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

Declaration
public static MessageLocation Of(object codeElement)
Parameters
Type Name Description
Object codeElement

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

Returns
Type Description
MessageLocation

A MessageLocation representing codeElement.

Remarks

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

Of(MemberInfo)

Builds a MessageLocation from a System.Reflection.MemberInfo (System.Type, MethodInfo, ConstructorInfo, System.Reflection.FieldInfo, System.Reflection.PropertyInfo, EventInfo).

Declaration
public static MessageLocation Of(MemberInfo member)
Parameters
Type Name Description
System.Reflection.MemberInfo member

An element of code (System.Type, MethodInfo, ConstructorInfo, System.Reflection.FieldInfo, System.Reflection.PropertyInfo, EventInfo).

Returns
Type Description
MessageLocation

A MessageLocation.

Of(ParameterInfo)

Builds a MessageLocation from a ParameterInfo.

Declaration
public static MessageLocation Of(ParameterInfo parameter)
Parameters
Type Name Description
ParameterInfo parameter

A ParameterInfo.

Returns
Type Description
MessageLocation

A MessageLocation.

Of(LocationInfo)

Builds a MessageLocation from a LocationInfo.

Declaration
public static MessageLocation Of(LocationInfo location)
Parameters
Type Name Description
LocationInfo location

A LocationInfo.

Returns
Type Description
MessageLocation

A MessageLocation.

Of(Assembly)

Builds a MessageLocation from an Assembly.

Declaration
public static MessageLocation Of(Assembly assembly)
Parameters
Type Name Description
Assembly assembly

An Assembly (Assembly or its wrapper).

Returns
Type Description
MessageLocation

A MessageLocation.

Of(IExpression)

Builds a MessageLocation from an IExpression.

Declaration
public static MessageLocation Of(IExpression expression)
Parameters
Type Name Description
IExpression expression

An IExpression.

Returns
Type Description
MessageLocation

A MessageLocation.