PostSharp.ILAPI ReferencePost­Sharp.​ExtensibilityMessageWrite
Open sandboxFocus

Message.Write Method

Write(Message)

Writes a message by providing a Message object.

Declaration
public static void Write(Message message)
Parameters
Type Name Description
Message message

A Message.

Write(MessageLocation, SeverityType, String, String)

Writes a message.

Declaration
public static void Write(MessageLocation messageLocation, SeverityType severity, string errorCode, string message)
Parameters
Type Name Description
MessageLocation messageLocation

Element of code (System.Reflection.Assembly, Type, System.Reflection.MethodInfo, System.Reflection.ConstructorInfo, PropertyInfo, System.Reflection.EventInfo or ParameterInfo) to which the message applies. When called from PostSharp.Sdk, the parameter can also contain a MetadataDeclaration.

SeverityType severity

Severity.

String errorCode

Error code.

String message

Error message.

Write(MessageLocation, SeverityType, String, String, Object[])

Writes a message.

Declaration
public static void Write(MessageLocation messageLocation, SeverityType severity, string errorCode, string format, params object[] arguments)
Parameters
Type Name Description
MessageLocation messageLocation

Element of code (System.Reflection.Assembly, Type, System.Reflection.MethodInfo, System.Reflection.ConstructorInfo, PropertyInfo, System.Reflection.EventInfo or ParameterInfo) to which the message applies. When called from PostSharp.Sdk, the parameter can also contain a MetadataDeclaration.

SeverityType severity

Severity.

String errorCode

Error code.

String format

Error message formatting string.

Object[] arguments

Formatting string arguments.

Write(MemberInfo, SeverityType, String, String, Object[])

Writes a message.

Declaration
public static void Write(MemberInfo codeElement, SeverityType severity, string errorCode, string format, params object[] arguments)
Parameters
Type Name Description
MemberInfo codeElement

Element of code to which the message applies.

SeverityType severity

Severity.

String errorCode

Error code.

String format

Error message formatting string.

Object[] arguments

Formatting string arguments.

Write(Type, SeverityType, String, String, Object[])

Writes a message.

Declaration
public static void Write(Type type, SeverityType severity, string errorCode, string format, params object[] arguments)
Parameters
Type Name Description
Type type

Element of code to which the message applies.

SeverityType severity

Severity.

String errorCode

Error code.

String format

Error message formatting string.

Object[] arguments

Formatting string arguments.

Write(ParameterInfo, SeverityType, String, String, Object[])

Writes a message.

Declaration
public static void Write(ParameterInfo codeElement, SeverityType severity, string errorCode, string format, params object[] arguments)
Parameters
Type Name Description
ParameterInfo codeElement

Element of code to which the message applies.

SeverityType severity

Severity.

String errorCode

Error code.

String format

Error message formatting string.

Object[] arguments

Formatting string arguments.

Write(Assembly, SeverityType, String, String, Object[])

Writes a message.

Declaration
public static void Write(Assembly codeElement, SeverityType severity, string errorCode, string format, params object[] arguments)
Parameters
Type Name Description
System.Reflection.Assembly codeElement

Element of code to which the message applies.

SeverityType severity

Severity.

String errorCode

Error code.

String format

Error message formatting string.

Object[] arguments

Formatting string arguments.

Write(LocationInfo, SeverityType, String, String, Object[])

Writes a message.

Declaration
public static void Write(LocationInfo codeElement, SeverityType severity, string errorCode, string format, params object[] arguments)
Parameters
Type Name Description
LocationInfo codeElement

Element of code to which the message applies.

SeverityType severity

Severity.

String errorCode

Error code.

String format

Error message formatting string.

Object[] arguments

Formatting string arguments.