Table of Contents

Class ReadOnlyObservableList<T>

Namespace
CarinaStudio.Collections
Assembly
CarinaStudio.AppBase.Core.dll

Read-only IList<T> which implements INotifyCollectionChanged and INotifyPropertyChanged then wraps another IList<T> which also implements INotifyCollectionChanged.

public class ReadOnlyObservableList<T> : IList, ICollection, IList<T>, ICollection<T>, INotifyCollectionChanged, INotifyPropertyChanged, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable

Type Parameters

T

Type of elements.

Inheritance
ReadOnlyObservableList<T>
Implements
Inherited Members
Extension Methods

Constructors

ReadOnlyObservableList(IList<T>)

Initialize new ReadOnlyObservableList<T> instance.

public ReadOnlyObservableList(IList<T> source)

Parameters

source IList<T>

Properties

Count

Get number of elements.

public int Count { get; }

Property Value

int

this[int]

Get element.

public T this[int index] { get; }

Parameters

index int

Index of element.

Property Value

T

Element.

Methods

Contains(T)

Check whether given element is contained in list or not.

public bool Contains(T element)

Parameters

element T

Element.

Returns

bool

True if element is contained in list.

CopyTo(T[], int)

Copy elements to array.

public void CopyTo(T[] array, int arrayIndex)

Parameters

array T[]

Array to place copied elements.

arrayIndex int

Index of first position in array to place copied elements.

GetEnumerator()

Get IEnumerator<T> to enumerate elements.

public IEnumerator<T> GetEnumerator()

Returns

IEnumerator<T>

IEnumerator<T>.

IndexOf(T)

Get index of given element in list.

public int IndexOf(T element)

Parameters

element T

Element.

Returns

int

Index of element in list, or -1 if element is not contained in list.

IsEmpty()

Check whether the list is empty or not.

public bool IsEmpty()

Returns

bool

True if the list is empty.

IsNotEmpty()

Check whether the list is not empty or not.

public bool IsNotEmpty()

Returns

bool

True if the list is not empty.

Events

CollectionChanged

Raised when list changed.

public event NotifyCollectionChangedEventHandler? CollectionChanged

Event Type

NotifyCollectionChangedEventHandler

PropertyChanged

Raised when property changed.

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler