Table of Contents

Class GameComponentCollection

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

A collection of IGameComponent instances.

public sealed class GameComponentCollection : Collection<IGameComponent>, IList<IGameComponent>, ICollection<IGameComponent>, IReadOnlyList<IGameComponent>, IReadOnlyCollection<IGameComponent>, IEnumerable<IGameComponent>, IList, ICollection, IEnumerable
Inheritance
GameComponentCollection
Implements
Inherited Members

Methods

ClearItems()

protected override void ClearItems()

InsertItem(int, IGameComponent)

Inserts an element into the Collection<T> at the specified index.

protected override void InsertItem(int index, IGameComponent item)

Parameters

index int

The zero-based index at which item should be inserted.

item IGameComponent

The object to insert. The value can be null for reference types.

Exceptions

ArgumentOutOfRangeException

index is less than zero.

-or-

index is greater than Count.

RemoveItem(int)

Removes the element at the specified index of the Collection<T>.

protected override void RemoveItem(int index)

Parameters

index int

The zero-based index of the element to remove.

Exceptions

ArgumentOutOfRangeException

index is less than zero.

-or-

index is equal to or greater than Count.

SetItem(int, IGameComponent)

Replaces the element at the specified index.

protected override void SetItem(int index, IGameComponent item)

Parameters

index int

The zero-based index of the element to replace.

item IGameComponent

The new value for the element at the specified index. The value can be null for reference types.

Exceptions

ArgumentOutOfRangeException

index is less than zero.

-or-

index is greater than Count.

Events

ComponentAdded

Event that is triggered when a GameComponent is added to this GameComponentCollection.

public event EventHandler<GameComponentCollectionEventArgs> ComponentAdded

Event Type

EventHandler<GameComponentCollectionEventArgs>

ComponentRemoved

Event that is triggered when a GameComponent is removed from this GameComponentCollection.

public event EventHandler<GameComponentCollectionEventArgs> ComponentRemoved

Event Type

EventHandler<GameComponentCollectionEventArgs>