Class ModelCollection<T>
Generic container for object model arrays
Inheritance
System.Object
System.Collections.ObjectModel.Collection<T>
System.Collections.ObjectModel.ObservableCollection<T>
ModelCollection<T>
Implements
System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IReadOnlyList<T>
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable
System.ICloneable
System.ComponentModel.INotifyPropertyChanged
System.Collections.Specialized.INotifyCollectionChanged
Inherited Members
System.Collections.ObjectModel.ObservableCollection<T>.BlockReentrancy()
System.Collections.ObjectModel.ObservableCollection<T>.CheckReentrancy()
System.Collections.ObjectModel.ObservableCollection<T>.InsertItem(System.Int32, T)
System.Collections.ObjectModel.ObservableCollection<T>.Move(System.Int32, System.Int32)
System.Collections.ObjectModel.ObservableCollection<T>.MoveItem(System.Int32, System.Int32)
System.Collections.ObjectModel.ObservableCollection<T>.OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs)
System.Collections.ObjectModel.ObservableCollection<T>.RemoveItem(System.Int32)
System.Collections.ObjectModel.ObservableCollection<T>.SetItem(System.Int32, T)
System.Collections.ObjectModel.ObservableCollection<T>.CollectionChanged
System.Collections.ObjectModel.ObservableCollection<T>.PropertyChanged
System.Collections.ObjectModel.ObservableCollection<T>.System.ComponentModel.INotifyPropertyChanged.PropertyChanged
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.get_Item(System.Int32)
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.set_Item(System.Int32, System.Object)
System.Collections.ObjectModel.Collection<T>.Add(T)
System.Collections.ObjectModel.Collection<T>.Clear()
System.Collections.ObjectModel.Collection<T>.Contains(T)
System.Collections.ObjectModel.Collection<T>.CopyTo(T[], System.Int32)
System.Collections.ObjectModel.Collection<T>.GetEnumerator()
System.Collections.ObjectModel.Collection<T>.IndexOf(T)
System.Collections.ObjectModel.Collection<T>.Insert(System.Int32, T)
System.Collections.ObjectModel.Collection<T>.Remove(T)
System.Collections.ObjectModel.Collection<T>.RemoveAt(System.Int32)
System.Collections.ObjectModel.Collection<T>.System.Collections.ICollection.CopyTo(System.Array, System.Int32)
System.Collections.ObjectModel.Collection<T>.System.Collections.IEnumerable.GetEnumerator()
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Add(System.Object)
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Contains(System.Object)
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.IndexOf(System.Object)
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Insert(System.Int32, System.Object)
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Remove(System.Object)
System.Collections.ObjectModel.Collection<T>.Count
System.Collections.ObjectModel.Collection<T>.Item[System.Int32]
System.Collections.ObjectModel.Collection<T>.Items
System.Collections.ObjectModel.Collection<T>.System.Collections.Generic.ICollection<T>.IsReadOnly
System.Collections.ObjectModel.Collection<T>.System.Collections.ICollection.IsSynchronized
System.Collections.ObjectModel.Collection<T>.System.Collections.ICollection.SyncRoot
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.IsFixedSize
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.IsReadOnly
System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Item[System.Int32]
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: DuetAPI.dll
Syntax
public class ModelCollection<T> : ObservableCollection<T>, IList<T>, ICollection<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable, IModelCollection, IModelObject, ICloneable, INotifyPropertyChanged, INotifyCollectionChanged
Type Parameters
Name |
Description |
T |
Item type
|
Methods
Assign(Object)
Assign the properties from another instance.
This is required to update model properties which do not have a setter
Declaration
public void Assign(object from)
Parameters
Type |
Name |
Description |
System.Object |
from |
Other instance
|
ClearItems()
Removes all items from the collection
Declaration
protected override void ClearItems()
Overrides
System.Collections.ObjectModel.ObservableCollection<T>.ClearItems()
Clone()
Create a clone of this list
Declaration
Returns
Type |
Description |
System.Object |
Cloned list
|
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
public object FindDifferences(IModelObject other)
Parameters
Returns
Type |
Description |
System.Object |
Object differences or null if both instances are equal
|
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Raises the change event handler
Declaration
protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
Parameters
Type |
Name |
Description |
System.Collections.Specialized.NotifyCollectionChangedEventArgs |
e |
Event arguments
|
Overrides
System.Collections.ObjectModel.ObservableCollection<T>.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs)
UpdateFromJson(JsonElement, Boolean)
Update this instance from a given JSON element
Declaration
public IModelObject UpdateFromJson(JsonElement jsonElement, bool ignoreSbcProperties)
Parameters
Type |
Name |
Description |
System.Text.Json.JsonElement |
jsonElement |
Element to update this intance from
|
System.Boolean |
ignoreSbcProperties |
Whether SBC properties are ignored
|
Returns
Exceptions
Type |
Condition |
System.Text.Json.JsonException |
Failed to deserialize data
|
UpdateFromJson(JsonElement, Boolean, Int32, Boolean)
Update this collection from a given JSON array
Declaration
public void UpdateFromJson(JsonElement jsonElement, bool ignoreSbcProperties, int offset = 0, bool last = true)
Parameters
Type |
Name |
Description |
System.Text.Json.JsonElement |
jsonElement |
Element to update this intance from
|
System.Boolean |
ignoreSbcProperties |
Whether SBC properties are ignored
|
System.Int32 |
offset |
Index offset
|
System.Boolean |
last |
Whether this is the last update
|
Implements
System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IReadOnlyList<T>
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable
System.ICloneable
System.ComponentModel.INotifyPropertyChanged
System.Collections.Specialized.INotifyCollectionChanged