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