PostSharpAPI 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 (Assembly, System.Type, MethodInfo, ConstructorInfo, System.Reflection.PropertyInfo, EventInfo or ParameterInfo) to which the message applies. When called from PostSharp.Sdk, the parameter can also contain a MetadataDeclaration.

SeverityType severity

Severity.

System.String errorCode

Error code.

System.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 (Assembly, System.Type, MethodInfo, ConstructorInfo, System.Reflection.PropertyInfo, EventInfo or ParameterInfo) to which the message applies. When called from PostSharp.Sdk, the parameter can also contain a MetadataDeclaration.

SeverityType severity

Severity.

System.String errorCode

Error code.

System.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
System.Reflection.MemberInfo codeElement

Element of code to which the message applies.

SeverityType severity

Severity.

System.String errorCode

Error code.

System.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
System.Type type

Element of code to which the message applies.

SeverityType severity

Severity.

System.String errorCode

Error code.

System.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.

System.String errorCode

Error code.

System.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
Assembly codeElement

Element of code to which the message applies.

SeverityType severity

Severity.

System.String errorCode

Error code.

System.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.

System.String errorCode

Error code.

System.String format

Error message formatting string.

Object[] arguments

Formatting string arguments.