Table of Contents

Class MessageCollection

Namespace
DuetAPI.ObjectModel
Assembly
DuetAPI.dll

Generic list container to which messages can only be added or cleared

public class MessageCollection : ObservableCollection<Message>, IList<Message>, ICollection<Message>, IList, ICollection, IReadOnlyList<Message>, IReadOnlyCollection<Message>, IEnumerable<Message>, IEnumerable, IModelCollection, IStaticModelObject, IModelObject, ICloneable, INotifyPropertyChanged, INotifyCollectionChanged
Inheritance
MessageCollection
Implements
Inherited Members

Constructors

MessageCollection()

public MessageCollection()

Methods

Assign(IStaticModelObject)

Assign the properties from another instance. This is required to update model properties which do not have a setter

public void Assign(IStaticModelObject from)

Parameters

from IStaticModelObject

Other instance

ClearItems()

Removes all items from the collection

protected override void ClearItems()

Clone()

Create a clone of this list

public object Clone()

Returns

object

Cloned list

OnCollectionChanged(NotifyCollectionChangedEventArgs)

Raises the change event handler

protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e)

Parameters

e NotifyCollectionChangedEventArgs

Event arguments

UpdateFromJson(JsonElement, bool)

Update this instance from a given JSON element

public void UpdateFromJson(JsonElement jsonElement, bool ignoreSbcProperties)

Parameters

jsonElement JsonElement

Element to update this intance from

ignoreSbcProperties bool

Whether SBC properties are ignored

Exceptions

JsonException

Failed to deserialize data

UpdateFromJson(JsonElement, bool, int, bool)

Update this collection from a given JSON array

public void UpdateFromJson(JsonElement jsonElement, bool ignoreSbcProperties, int offset = 0, bool last = true)

Parameters

jsonElement JsonElement

Element to update this intance from

ignoreSbcProperties bool

Whether SBC properties are ignored

offset int

Index offset

last bool

Whether this is the last update

UpdateFromJsonReader(ref Utf8JsonReader, bool)

Update this instance from a given JSON reader

public void UpdateFromJsonReader(ref Utf8JsonReader reader, bool ignoreSbcProperties)

Parameters

reader Utf8JsonReader

JSON reader

ignoreSbcProperties bool

Whether SBC properties are ignored

Exceptions

JsonException

Failed to deserialize data

UpdateFromJsonReader(ref Utf8JsonReader, bool, int, bool)

Update this collection from a given JSON reader

public void UpdateFromJsonReader(ref Utf8JsonReader reader, bool ignoreSbcProperties, int offset = 0, bool last = true)

Parameters

reader Utf8JsonReader

JSON reader

ignoreSbcProperties bool

Whether SBC properties are ignored

offset int

Index offset

last bool

Whether this is the last update