Interface IModelObject
Basic interface for object model classes that have properties
Namespace: DuetAPI.ObjectModel
Assembly: DuetAPI.dll
Syntax
public interface IModelObject : ICloneable, INotifyPropertyChanged
Methods
Assign(object)
Assign the properties from another instance. This is required to update model properties which do not have a setter
Declaration
void Assign(object from)
Parameters
Type | Name | Description |
---|---|---|
object | from | Other instance |
FindDifferences(IModelObject)
Create a dictionary or list of all the differences between this instance and another. This method outputs own property values that differ from the other instance
Declaration
object? FindDifferences(IModelObject other)
Parameters
Type | Name | Description |
---|---|---|
IModelObject | other | Other instance |
Returns
Type | Description |
---|---|
object | Object differences or null if both instances are equal |
UpdateFromJson(JsonElement, bool)
Update this instance from a given JSON element
Declaration
IModelObject? UpdateFromJson(JsonElement jsonElement, bool ignoreSbcProperties)
Parameters
Type | Name | Description |
---|---|---|
JsonElement | jsonElement | Element to update this intance from |
bool | ignoreSbcProperties | Whether SBC properties are ignored |
Returns
Type | Description |
---|---|
IModelObject | Updated instance |
Exceptions
Type | Condition |
---|---|
JsonException | Failed to deserialize data |