Table of Contents

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

type MessageType

Message type

content string

Message content

Properties

Content

Content of this message

public string Content { get; set; }

Property Value

string

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

DateTime

Type

Type of this message

public MessageType Type { get; set; }

Property Value

MessageType

Methods

Append(Message)

Append another message to this one, potentially overwriting the message type

public void Append(Message other)

Parameters

other Message

Message to append

Append(MessageType, string)

Append another message to this one, potentially overwriting the message type

public void Append(MessageType type, string content)

Parameters

type MessageType

Message type

content string

Message content

AppendLine(string)

Replace the content if empty or append a new line that is not empty

public void AppendLine(string line)

Parameters

line string

Line 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