Open sandboxFocus

Method Write

Write(Message)

Writes a message by providing a Message object.

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

The message to write.

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

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

SeverityType severity

The severity.

string errorCode

The error code.

string message

The error message.

Write(MessageLocation, SeverityType, string, string, params 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

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

SeverityType severity

The severity.

string errorCode

The error code.

string format

The error message formatting string.

object[] arguments

The arguments of the formatting string.

Write(MemberInfo, SeverityType, string, string, params 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

The element of code to which the message applies.

SeverityType severity

The severity.

string errorCode

The error code.

string format

The error message formatting string.

object[] arguments

The arguments of the formatting string.

Write(Type, SeverityType, string, string, params 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

The element of code to which the message applies.

SeverityType severity

The severity.

string errorCode

The error code.

string format

The error message formatting string.

object[] arguments

The arguments of the formatting string.

Write(ParameterInfo, SeverityType, string, string, params 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

The element of code to which the message applies.

SeverityType severity

The severity.

string errorCode

The error code.

string format

The error message formatting string.

object[] arguments

The arguments of the formatting string.

Write(Assembly, SeverityType, string, string, params 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

The element of code to which the message applies.

SeverityType severity

The severity.

string errorCode

The error code.

string format

The error message formatting string.

object[] arguments

The arguments of the formatting string.

Write(LocationInfo, SeverityType, string, string, params 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

The element of code to which the message applies.

SeverityType severity

The severity.

string errorCode

The error code.

string format

The error message formatting string.

object[] arguments

The arguments of the formatting string.