ScreenObjectCollection<TScreenObject> Class
Definition
Section titled “Definition”Manages the parent and children relationship for IScreenObject.
public class ScreenObjectCollection<TScreenObject> : IReadOnlyList<TScreenObject>, IReadOnlyCollection<TScreenObject>, IEnumerable<TScreenObject>, IEnumerable where TScreenObject : class, IScreenObjectType Parameters
Section titled “Type Parameters”TScreenObject
Inheritance object
Implements IReadOnlyList<TScreenObject>, IReadOnlyCollection<TScreenObject>, IEnumerable<TScreenObject>, IEnumerable
Constructors
Section titled “Constructors”ScreenObjectCollection(IScreenObject)
Section titled “ScreenObjectCollection(IScreenObject)”Creates a new object collection and parents it to the owner object.
public ScreenObjectCollection(IScreenObject owner)Parameters
Section titled “Parameters”owner IScreenObject
The owning object of this collection.
Fields
Section titled “Fields”_objects
Section titled “_objects”Internal list of objects.
protected List<TScreenObject> _objects_owningObject
Section titled “_owningObject”The parent object.
protected IScreenObject _owningObjectProperties
Section titled “Properties”Returns the total number of objects in this collection.
public int Count { get; }IsLocked
Section titled “IsLocked”When true, the collection cannot be modified.
public bool IsLocked { get; set; }this[int]
Section titled “this[int]”Gets or sets a child object for this collection.
public TScreenObject this[int index] { get; set; }Methods
Section titled “Methods”Clear()
Section titled “Clear()”Removes all consoles.
public void Clear()Contains(TScreenObject)
Section titled “Contains(TScreenObject)”Returns true if this console list contains the specified obj.
public bool Contains(TScreenObject obj)Parameters
Section titled “Parameters”obj TScreenObject
The console to search for.
Returns
Section titled “Returns”IsTop(TScreenObject)
Section titled “IsTop(TScreenObject)”When true, indicates that the obj is at the top of the collection stack.
public bool IsTop(TScreenObject obj)Parameters
Section titled “Parameters”obj TScreenObject
The obj object to check.
Returns
Section titled “Returns”bool
True when the object is on the top.
IsBottom(TScreenObject)
Section titled “IsBottom(TScreenObject)”When true, indicates that the obj is at the bottom of the collection stack.
public bool IsBottom(TScreenObject obj)Parameters
Section titled “Parameters”obj TScreenObject
The obj object to check.
Returns
Section titled “Returns”bool
True when the object is on the bottom.
Add(TScreenObject)
Section titled “Add(TScreenObject)”Adds a new child object to this collection.
public void Add(TScreenObject obj)Parameters
Section titled “Parameters”obj TScreenObject
The child object.
Exceptions
Section titled “Exceptions”Exception
Thrown when the IsLocked property is set to true.
Insert(int, TScreenObject)
Section titled “Insert(int, TScreenObject)”Inserts a child object at the specified index.
public void Insert(int index, TScreenObject obj)Parameters
Section titled “Parameters”index int
The 0-based index to insert the object at.
obj TScreenObject
The child object.
Exceptions
Section titled “Exceptions”Exception
Thrown when the IsLocked property is set to true.
Remove(TScreenObject)
Section titled “Remove(TScreenObject)”Removes a new child object from this collection.
public void Remove(TScreenObject obj)Parameters
Section titled “Parameters”obj TScreenObject
The child object.
Exceptions
Section titled “Exceptions”Exception
Thrown when the IsLocked property is set to true.
Sort(IComparer<IScreenObject>)
Section titled “Sort(IComparer<IScreenObject>)”Sorts the collection based on SortOrder.
public void Sort(IComparer<IScreenObject> comparer)Parameters
Section titled “Parameters”comparer IComparer<IScreenObject>
The comparer to use
Exceptions
Section titled “Exceptions”Exception
Thrown when the IsLocked property is set to true.
ToArray()
Section titled “ToArray()”Copies the collections item to an array.
public TScreenObject[] ToArray()Returns
Section titled “Returns”TScreenObject[]
A new array consisting of all of the objects in this collection.
MoveToTop(TScreenObject)
Section titled “MoveToTop(TScreenObject)”Moves the specified obj to the top of the collection.
public void MoveToTop(TScreenObject obj)Parameters
Section titled “Parameters”obj TScreenObject
The child object.
MoveToBottom(TScreenObject)
Section titled “MoveToBottom(TScreenObject)”Moves the specified obj to the bottom of the collection.
public void MoveToBottom(TScreenObject obj)Parameters
Section titled “Parameters”obj TScreenObject
The child object.
IndexOf(TScreenObject)
Section titled “IndexOf(TScreenObject)”Gets the 0-based index of the obj.
public int IndexOf(TScreenObject obj)Parameters
Section titled “Parameters”obj TScreenObject
The child object.
Returns
Section titled “Returns”GetEnumerator()
Section titled “GetEnumerator()”public IEnumerator<TScreenObject> GetEnumerator()Returns
Section titled “Returns”Events
Section titled “Events”CollectionChanged
Section titled “CollectionChanged”Raised when the items in this collection are added, removed, or repositioned.
public event EventHandler? CollectionChanged