4 using System.Collections.Generic;
5 using System.Collections.ObjectModel;
6 using System.Collections.Specialized;
7 using SiliconStudio.Core.Serialization.Serializers;
9 namespace SiliconStudio.Core.Collections
21 public class FastCollection<T> : Collection<T>
29 foreach (var item
in items)
42 return ((List<T>)Items).GetEnumerator();
51 ((List<T>)Items).Sort();
58 public void Sort(Comparison<T> comparison)
61 ((List<T>)Items).Sort(comparison);
68 public void Sort(Comparer<T> comparer)
71 ((List<T>)Items).Sort(comparer);
88 base.InsertItem(index, item);
89 var collectionChanged = CollectionChanged;
90 if (collectionChanged != null)
97 var collectionChanged = CollectionChanged;
98 if (collectionChanged != null)
100 base.RemoveItem(index);
106 var collectionChanged = CollectionChanged;
107 if (collectionChanged != null)
109 for (
int i = Items.Count - 1; i >= 0; --i)
116 protected override void SetItem(
int index, T item)
118 var collectionChanged = CollectionChanged;
119 object oldItem = (collectionChanged != null) ? (
object)Items[index] : null;
120 if (collectionChanged != null)
122 base.SetItem(index, item);
123 if (collectionChanged != null)
override void ClearItems()
DataSerializerGenericMode
Defines what generic parameters to pass to the serializer.
override void SetItem(int index, T item)
void AddRange(IEnumerable< T > items)
Adds the elements of the specified source to the end of FastCollection{T}.
void Sort()
Sorts the element in this FastCollection{T} using the default comparer.
override void InsertItem(int index, T item)
EventHandler< TrackingCollectionChangedEventArgs > CollectionChanged
EventHandler< TrackingCollectionChangedEventArgs > CollectionChanged
void Sort(Comparer< T > comparer)
Sorts the element in this FastCollection{T} using the specified comparer.
override void RemoveItem(int index)
void Sort(Comparison< T > comparison)
Sorts the element in this FastCollection{T} using the specified comparer.
new List< T >.Enumerator GetEnumerator()
Gets the enumerator.