Encapsulates a message, such as an error, a warning or an information message.
Namespace: PostSharp.Extensibility
Assembly: PostSharp.dll
Syntax
public sealed class MessageRemarks
Build-time code, such as an implementation of CompileTimeValidate(object), emits messages with the
static Write methods of this class. They appear in the build output and in Visual Studio. Each message has a severity, an identifier,
a text, and preferably a location: users can suppress a warning on a specific element of code with SuppressWarningAttribute
only when the message has a location. Pass the message arguments to the Write methods instead of formatting the text yourself,
so that PostSharp can render arguments such as reflection objects in a readable way.
To keep the texts of many messages in a single place, emit them through a MessageSource instead.
Constructors
| Name | Description |
|---|---|
| Message(MessageLocation, SeverityType, string, string, string, string, Exception) | Initializes a new instance of the Message class and specifies all its properties. |
| Message(SeverityType, string, string, string, string, string, int, int, Exception) | Initializes a new instance of the Message class and specifies all its properties. |
| Message(SeverityType, string, string, string, string, string, int, int, int, int, Exception) | Initializes a new instance of the Message class and specifies all its properties. |
Fields
| Name | Description |
|---|---|
| NotAvailable | When set to the |
Properties
| Name | Description |
|---|---|
| HelpLink | Gets the help link. |
| InnerException | Gets the exception that caused this message, or |
| Location | Gets the location of the source code artifact that causes the message. |
| MessageId | Gets the message type identifier. |
| MessageText | Gets the formatted message text. |
| Severity | Gets the message severity. |
| Source | Gets the name of the source component. |
Methods
| Name | Description |
|---|---|
| GetExceptionStackMessage(Exception) | Returns a string composed of the messages of all inner exceptions. |
| Write(Message) | Writes a message by providing a Message object. |
| Write(MessageLocation, SeverityType, string, string) | Writes a message. |
| Write(MessageLocation, SeverityType, string, string, params object[]) | Writes a message. |
| Write(LocationInfo, SeverityType, string, string, params object[]) | Writes a message. |
| Write(Assembly, SeverityType, string, string, params object[]) | Writes a message. |
| Write(MemberInfo, SeverityType, string, string, params object[]) | Writes a message. |
| Write(ParameterInfo, SeverityType, string, string, params object[]) | Writes a message. |
| Write(Type, SeverityType, string, string, params object[]) | Writes a message. |