Class Message
Generic container for messages
Inherited Members
Namespace: DuetAPI.ObjectModel
Assembly: DuetAPI.dll
Syntax
public sealed class Message
Constructors
Message()
Create a new message
Declaration
public Message()
Message(MessageType, string)
Create a new message
Declaration
public Message(MessageType type, string content = "")
Parameters
Type | Name | Description |
---|---|---|
MessageType | type | Message type |
string | content | Message content |
Properties
Content
Content of this message
Declaration
public string Content { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
May be empty but not null
Time
Time at which the message was generated
Declaration
[JsonConverter(typeof(JsonShortDateTimeConverter))]
public DateTime Time { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
Type
Type of this message
Declaration
public MessageType Type { get; set; }
Property Value
Type | Description |
---|---|
MessageType |
Methods
Append(Message)
Append another message to this one, potentially overwriting the message type
Declaration
public void Append(Message other)
Parameters
Type | Name | Description |
---|---|---|
Message | other | Message to append |
Append(MessageType, string)
Append another message to this one, potentially overwriting the message type
Declaration
public void Append(MessageType type, string content)
Parameters
Type | Name | Description |
---|---|---|
MessageType | type | Message type |
string | content | Message content |
AppendLine(string)
Replace the content if empty or append a new line that is not empty
Declaration
public void AppendLine(string line)
Parameters
Type | Name | Description |
---|---|---|
string | line | Line content |
ToString()
Converts this message to a RepRapFirmware-style message
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | RepRapFirmware-style message |