Table of Contents

Class ChildCollection<TParent, TChild>

Namespace
Microsoft.Xna.Framework.Content.Pipeline
Assembly
MonoGame.Framework.Content.Pipeline.dll

Provides a collection of child objects for a content item.

Links from a child object to its parent are maintained as the collection contents are modified.

public abstract class ChildCollection<TParent, TChild> : Collection<TChild>, IList<TChild>, ICollection<TChild>, IReadOnlyList<TChild>, IReadOnlyCollection<TChild>, IEnumerable<TChild>, IList, ICollection, IEnumerable where TParent : class where TChild : class

Type Parameters

TParent
TChild
Inheritance
Collection<TChild>
ChildCollection<TParent, TChild>
Implements
IList<TChild>
ICollection<TChild>
IEnumerable<TChild>
Derived
Inherited Members

Constructors

ChildCollection(TParent)

Creates an instance of ChildCollection.

protected ChildCollection(TParent parent)

Parameters

parent TParent

Parent object of the child objects returned in the collection.

Methods

ClearItems()

Removes all children from the collection.

protected override void ClearItems()

GetParent(TChild)

Gets the parent of a child object.

protected abstract TParent GetParent(TChild child)

Parameters

child TChild

The child of the parent being retrieved.

Returns

TParent

The parent of the child object.

InsertItem(int, TChild)

Inserts a child object into the collection at the specified location.

protected override void InsertItem(int index, TChild item)

Parameters

index int

The position in the collection.

item TChild

The child object being inserted.

RemoveItem(int)

Removes a child object from the collection.

protected override void RemoveItem(int index)

Parameters

index int

The index of the item being removed.

SetItem(int, TChild)

Modifies the value of the child object at the specified location.

protected override void SetItem(int index, TChild item)

Parameters

index int

The index of the child object being modified.

item TChild

The new value for the child object.

SetParent(TChild, TParent)

Modifies the value of the parent object of the specified child object.

protected abstract void SetParent(TChild child, TParent parent)

Parameters

child TChild

The child of the parent being modified.

parent TParent

The new value for the parent object.