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
fromIStaticModelObjectOther 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
eNotifyCollectionChangedEventArgsEvent arguments
UpdateFromJson(JsonElement, bool)
Update this instance from a given JSON element
public void UpdateFromJson(JsonElement jsonElement, bool ignoreSbcProperties)
Parameters
jsonElementJsonElementElement to update this intance from
ignoreSbcPropertiesboolWhether 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
jsonElementJsonElementElement to update this intance from
ignoreSbcPropertiesboolWhether SBC properties are ignored
offsetintIndex offset
lastboolWhether 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
readerUtf8JsonReaderJSON reader
ignoreSbcPropertiesboolWhether 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
readerUtf8JsonReaderJSON reader
ignoreSbcPropertiesboolWhether SBC properties are ignored
offsetintIndex offset
lastboolWhether this is the last update