Show / Hide Table of Contents

Class ControllerList<T>

A thread-safe list of items, which automatically handles changed calls when mutating the list. Initialize must be called before use.

Inheritance
System.Object
ThreadSafeList<T>
ControllerList<T>
Implements
System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IList
System.Collections.ICollection
System.Collections.Generic.IReadOnlyList<T>
System.Collections.Generic.IReadOnlyCollection<T>
ISnapshotable<T>
ISnapshotable
IClientControlledList
IClientControlledContainer
ITrackedControllerEnumerable
ITrackedEnumerable
System.Collections.IEnumerable
Inherited Members
ThreadSafeList<T>.Contains(T)
ThreadSafeList<T>.CopyTo(T[], Int32)
ThreadSafeList<T>.IndexOf(T)
ThreadSafeList<T>.ToArray()
ThreadSafeList<T>.ToList()
ThreadSafeList<T>.RemoveAt(Int32)
ThreadSafeList<T>.RemoveNulls()
ThreadSafeList<T>.WithSnapshot<TResult>(Func<IReadOnlyList<T>, TResult>)
ThreadSafeList<T>.WithSnapshot(Action<IReadOnlyList<T>>)
ThreadSafeList<T>.GetAt(Int32)
ThreadSafeList<T>.IndexOf(Object)
ThreadSafeList<T>.GetEnumerator()
ThreadSafeList<T>.Collection
ThreadSafeList<T>.Count
ThreadSafeList<T>.IsReadOnly
ThreadSafeList<T>.IsFixedSize
ThreadSafeList<T>.SyncRoot
ThreadSafeList<T>.IsSynchronized
ThreadSafeList<T>.TypeName
ThreadSafeList<T>.Snapshot
ThreadSafeList<T>.ISnapshotable<T>.Snapshot
ThreadSafeList<T>.ISnapshotable.Snapshot
Namespace: Eco.Core.Utils
Assembly: Eco.Core.dll
Syntax
public class ControllerList<T> : ThreadSafeList<T>, IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>, ISnapshotable<T>, ISnapshotable, IClientControlledList, IClientControlledContainer, ITrackedControllerEnumerable, ITrackedEnumerable, IEnumerable
Type Parameters
Name Description
T

Constructors

ControllerList()

Declaration
protected ControllerList()

ControllerList(IController, String)

Declaration
public ControllerList(IController parent, [ControllerPropertyName(null)] string propertyName)
Parameters
Type Name Description
IController parent
System.String propertyName

ControllerList(IController, String, IEnumerable<T>)

Declaration
public ControllerList(IController parent, [ControllerPropertyName(null)] string propertyName, IEnumerable<T> contents)
Parameters
Type Name Description
IController parent
System.String propertyName
System.Collections.Generic.IEnumerable<T> contents

Properties

Callbacks

Declaration
public TrackingCallbacks Callbacks { get; }
Property Value
Type Description
TrackingCallbacks

Item[Int32]

Declaration
public override T this[int i] { get; set; }
Parameters
Type Name Description
System.Int32 i
Property Value
Type Description
T
Overrides
Eco.Core.Utils.ThreadSafeList<T>.Item[System.Int32]

Parent

Declaration
public IController Parent { get; }
Property Value
Type Description
IController

PropertyName

Declaration
public string PropertyName { get; }
Property Value
Type Description
System.String

Type

Declaration
public Type Type { get; }
Property Value
Type Description
System.Type

Methods

Add(T)

Declaration
public override void Add(T item)
Parameters
Type Name Description
T item
Overrides
Eco.Core.Utils.ThreadSafeList<T>.Add(T)

AddOrReplace(T, Predicate<T>)

Declaration
public override void AddOrReplace(T item, Predicate<T> matcher)
Parameters
Type Name Description
T item
System.Predicate<T> matcher
Overrides
Eco.Core.Utils.ThreadSafeList<T>.AddOrReplace(T, System.Predicate<T>)

AddRange(IEnumerable<T>)

Declaration
public override void AddRange(IEnumerable<T> items)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<T> items
Overrides
Eco.Core.Utils.ThreadSafeList<T>.AddRange(System.Collections.Generic.IEnumerable<T>)

Clear()

Declaration
public override void Clear()
Overrides
Eco.Core.Utils.ThreadSafeList<T>.Clear()

Destroy()

Declaration
public Action<INetObject, object> Destroy()
Returns
Type Description
System.Action<INetObject, System.Object>

GetAndClear()

Declaration
public override ImmutableList<T> GetAndClear()
Returns
Type Description
System.Collections.Immutable.ImmutableList<T>
Overrides
Eco.Core.Utils.ThreadSafeList<T>.GetAndClear()

GetOrCreate(Predicate<T>, Func<T>)

Declaration
public override T GetOrCreate(Predicate<T> test, Func<T> create)
Parameters
Type Name Description
System.Predicate<T> test
System.Func<T> create
Returns
Type Description
T
Overrides
Eco.Core.Utils.ThreadSafeList<T>.GetOrCreate(System.Predicate<T>, System.Func<T>)

Insert(Int32, T)

Declaration
public override void Insert(int index, T item)
Parameters
Type Name Description
System.Int32 index
T item
Overrides
Eco.Core.Utils.ThreadSafeList<T>.Insert(System.Int32, T)

Move(Int32, Int32)

Declaration
public override void Move(int index, int newIndex)
Parameters
Type Name Description
System.Int32 index
System.Int32 newIndex
Overrides
Eco.Core.Utils.ThreadSafeList<T>.Move(System.Int32, System.Int32)

Remove(T)

Declaration
public override bool Remove(T item)
Parameters
Type Name Description
T item
Returns
Type Description
System.Boolean
Overrides
Eco.Core.Utils.ThreadSafeList<T>.Remove(T)

RemoveAll(Predicate<T>)

Declaration
public override int RemoveAll(Predicate<T> predicate)
Parameters
Type Name Description
System.Predicate<T> predicate
Returns
Type Description
System.Int32
Overrides
Eco.Core.Utils.ThreadSafeList<T>.RemoveAll(System.Predicate<T>)

RemoveAll(Predicate<T>, out ImmutableList<T>)

Declaration
public override void RemoveAll(Predicate<T> match, out ImmutableList<T> removed)
Parameters
Type Name Description
System.Predicate<T> match
System.Collections.Immutable.ImmutableList<T> removed
Overrides
Eco.Core.Utils.ThreadSafeList<T>.RemoveAll(System.Predicate<T>, System.Collections.Immutable.ImmutableList<T>)

RemoveAtAndReturn(Int32)

Remove the indexed element atomically and return it (and call callbacks on it)

Declaration
public override T RemoveAtAndReturn(int index)
Parameters
Type Name Description
System.Int32 index
Returns
Type Description
T
Overrides
Eco.Core.Utils.ThreadSafeList<T>.RemoveAtAndReturn(System.Int32)

RemoveFirst(Predicate<T>)

Declaration
public override bool RemoveFirst(Predicate<T> matcher)
Parameters
Type Name Description
System.Predicate<T> matcher
Returns
Type Description
System.Boolean
Overrides
Eco.Core.Utils.ThreadSafeList<T>.RemoveFirst(System.Predicate<T>)

RemoveRange(IEnumerable<T>)

Declaration
public override bool RemoveRange(IEnumerable<T> items)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<T> items
Returns
Type Description
System.Boolean
Overrides
Eco.Core.Utils.ThreadSafeList<T>.RemoveRange(System.Collections.Generic.IEnumerable<T>)

Set(INetObject, IEnumerable<T>)

Declaration
public bool Set(INetObject caller, IEnumerable<T> entries)
Parameters
Type Name Description
INetObject caller
System.Collections.Generic.IEnumerable<T> entries
Returns
Type Description
System.Boolean

Set(IEnumerable<T>)

Declaration
public override void Set(IEnumerable<T> entries)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<T> entries
Overrides
Eco.Core.Utils.ThreadSafeList<T>.Set(System.Collections.Generic.IEnumerable<T>)

SetAt(Int32, T)

Declaration
public override void SetAt(int index, T obj)
Parameters
Type Name Description
System.Int32 index
T obj
Overrides
Eco.Core.Utils.ThreadSafeList<T>.SetAt(System.Int32, T)

Sort()

Declaration
public override void Sort()
Overrides
Eco.Core.Utils.ThreadSafeList<T>.Sort()

Sort(IComparer<T>)

Declaration
public override void Sort(IComparer<T> comparer)
Parameters
Type Name Description
System.Collections.Generic.IComparer<T> comparer
Overrides
Eco.Core.Utils.ThreadSafeList<T>.Sort(System.Collections.Generic.IComparer<T>)

Sort(Comparison<T>)

Declaration
public override void Sort(Comparison<T> comparison)
Parameters
Type Name Description
System.Comparison<T> comparison
Overrides
Eco.Core.Utils.ThreadSafeList<T>.Sort(System.Comparison<T>)

Sort(Int32, Int32, IComparer<T>)

Declaration
public override void Sort(int index, int count, IComparer<T> comparer)
Parameters
Type Name Description
System.Int32 index
System.Int32 count
System.Collections.Generic.IComparer<T> comparer
Overrides
Eco.Core.Utils.ThreadSafeList<T>.Sort(System.Int32, System.Int32, System.Collections.Generic.IComparer<T>)

TryAdd(INetObject)

Add and use the callbacks if they exist.

Declaration
public (object, bool) TryAdd(INetObject obj)
Parameters
Type Name Description
INetObject obj
Returns
Type Description
System.ValueTuple<System.Object, System.Boolean>

Valid()

Declaration
public object Valid()
Returns
Type Description
System.Object

Explicit Interface Implementations

IClientControlledContainer.Add(INetObject, Object)

Declaration
bool IClientControlledContainer.Add(INetObject caller, object obj)
Parameters
Type Name Description
INetObject caller
System.Object obj
Returns
Type Description
System.Boolean

IClientControlledContainer.Remove(INetObject, Object)

Declaration
bool IClientControlledContainer.Remove(INetObject caller, object obj)
Parameters
Type Name Description
INetObject caller
System.Object obj
Returns
Type Description
System.Boolean

IClientControlledContainer.Set(INetObject, IEnumerable<Object>)

Declaration
bool IClientControlledContainer.Set(INetObject caller, IEnumerable<object> entries)
Parameters
Type Name Description
INetObject caller
System.Collections.Generic.IEnumerable<System.Object> entries
Returns
Type Description
System.Boolean

IClientControlledList.GetAt(Int32)

Declaration
object IClientControlledList.GetAt(int index)
Parameters
Type Name Description
System.Int32 index
Returns
Type Description
System.Object

IClientControlledList.Move(INetObject, Int32, Int32)

Declaration
void IClientControlledList.Move(INetObject caller, int iEntry, int newIndex)
Parameters
Type Name Description
INetObject caller
System.Int32 iEntry
System.Int32 newIndex

IClientControlledList.RemoveAt(INetObject, Int32)

Declaration
void IClientControlledList.RemoveAt(INetObject caller, int iEntry)
Parameters
Type Name Description
INetObject caller
System.Int32 iEntry

IClientControlledList.SetAt(INetObject, Int32, Object)

Declaration
void IClientControlledList.SetAt(INetObject caller, int index, object obj)
Parameters
Type Name Description
INetObject caller
System.Int32 index
System.Object obj

Implements

System.Collections.Generic.IList<>
System.Collections.Generic.ICollection<>
System.Collections.Generic.IEnumerable<>
System.Collections.IList
System.Collections.ICollection
System.Collections.Generic.IReadOnlyList<>
System.Collections.Generic.IReadOnlyCollection<>
ISnapshotable<T>
ISnapshotable
IClientControlledList
IClientControlledContainer
ITrackedControllerEnumerable
ITrackedEnumerable
System.Collections.IEnumerable

Extension Methods

PropertyChanges.FirePropertyChanged(Object, String)
PropertyChanges.FirePropertyChanged(Object, String, Object, Object)
PropertyChanges.FirePropertyChanged(Object, MemberChangedBeforeAfterEventArgs)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾