Skip to content

ScreenObjectCollection<TScreenObject> Class

Manages the parent and children relationship for IScreenObject.

C#
public class ScreenObjectCollection<TScreenObject> : IReadOnlyList<TScreenObject>, IReadOnlyCollection<TScreenObject>, IEnumerable<TScreenObject>, IEnumerable where TScreenObject : class, IScreenObject

TScreenObject

Inheritance object

Implements IReadOnlyList<TScreenObject>, IReadOnlyCollection<TScreenObject>, IEnumerable<TScreenObject>, IEnumerable

Creates a new object collection and parents it to the owner object.

C#
public ScreenObjectCollection(IScreenObject owner)

owner IScreenObject
The owning object of this collection.

Internal list of objects.

C#
protected List<TScreenObject> _objects

The parent object.

C#
protected IScreenObject _owningObject

Returns the total number of objects in this collection.

C#
public int Count { get; }

When true, the collection cannot be modified.

C#
public bool IsLocked { get; set; }

Gets or sets a child object for this collection.

C#
public TScreenObject this[int index] { get; set; }

Removes all consoles.

C#
public void Clear()

Returns true if this console list contains the specified obj.

C#
public bool Contains(TScreenObject obj)

obj TScreenObject
The console to search for.

bool

When true, indicates that the obj is at the top of the collection stack.

C#
public bool IsTop(TScreenObject obj)

obj TScreenObject
The obj object to check.

bool
True when the object is on the top.

When true, indicates that the obj is at the bottom of the collection stack.

C#
public bool IsBottom(TScreenObject obj)

obj TScreenObject
The obj object to check.

bool
True when the object is on the bottom.

Adds a new child object to this collection.

C#
public void Add(TScreenObject obj)

obj TScreenObject
The child object.

Exception
Thrown when the IsLocked property is set to true.

Inserts a child object at the specified index.

C#
public void Insert(int index, TScreenObject obj)

index int
The 0-based index to insert the object at.

obj TScreenObject
The child object.

Exception
Thrown when the IsLocked property is set to true.

Removes a new child object from this collection.

C#
public void Remove(TScreenObject obj)

obj TScreenObject
The child object.

Exception
Thrown when the IsLocked property is set to true.

Sorts the collection based on SortOrder.

C#
public void Sort(IComparer<IScreenObject> comparer)

comparer IComparer<IScreenObject>
The comparer to use

Exception
Thrown when the IsLocked property is set to true.

Copies the collections item to an array.

C#
public TScreenObject[] ToArray()

TScreenObject[]
A new array consisting of all of the objects in this collection.

Moves the specified obj to the top of the collection.

C#
public void MoveToTop(TScreenObject obj)

obj TScreenObject
The child object.

Moves the specified obj to the bottom of the collection.

C#
public void MoveToBottom(TScreenObject obj)

obj TScreenObject
The child object.

Gets the 0-based index of the obj.

C#
public int IndexOf(TScreenObject obj)

obj TScreenObject
The child object.

int

C#
public IEnumerator<TScreenObject> GetEnumerator()

IEnumerator<TScreenObject>

Raised when the items in this collection are added, removed, or repositioned.

C#
public event EventHandler? CollectionChanged

EventHandler