Advertisement
Guest User

List from ListCore

a guest
Aug 4th, 2014
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.29 KB | None | 0 0
  1. using System; using System.Collections; using System.Collections.Generic;
  2. using System.ComponentModel; namespace Fire {
  3. //##################################################################################################
  4. [XmlProps(""), Props("")]
  5. public partial class FireList<T>: ListCore<T>, IFireList<T>, IFireList, IClearable {
  6. public FireList() { }
  7. public FireList(int capacity) : base(capacity) { }
  8. public FireList(ICollection<T> src) : base(src) { }
  9. public FireList(IEnumerable<T> src) : base(src) { }
  10. public FireList(IEnumerable src) : base(src) { }
  11. public FireList(T[] src, bool swallow) : base(src, swallow) { }
  12. public FireList(T[] src, int from) : base(src, from) { }
  13. public FireList(T[] src, int from, int count) : base(src, from, count) { }
  14. //------------------------------------------------------------------------------------------
  15. public void EnsureCapacity(int min) { EnsureCapacityCore(min); }
  16. public void Grow() { GrowCore(); }
  17. public int Capacity { get { return items.Length; } set { CapacityCore = value; } }
  18. public int Count { get { return size; } set { CountCore = value; } }
  19. //------------------------------------------------------------------------------------------
  20. public T this[int index] { get { return GetCore(index); } set { SetCore(index, value); } }
  21. public IEnumerator<T> GetEnumerator() { return GetEnumeratorCore(); }
  22. //------------------------------------------------------------------------------------------
  23. public void Add(T item) { AddCore(item); }
  24. public void Insert(int index, T item) { InsertCore(index, item); }
  25. public T TryAdd(T item) { return TryAddCore(item); }
  26. public void AddRange(T[] a) { AddRangeCore(a); }
  27. public void InsertRange(int index, T[] a) { InsertRange(index, a); }
  28. public void AddRange(ICollection<T> src) { AddRangeCore(src); }
  29. public void InsertRange(int index, ICollection<T> src) { InsertRangeCore(index, src); }
  30. public void AddRange2(ICollection src) { AddRangeCore2(src); }
  31. public void InsertRange2(int index, ICollection src) { InsertRangeCore2(index, src); }
  32. public void AddRange(T[] src, int from) { AddRangeCore(src, from); }
  33. public void InsertRange(int index, T[] src, int from) { InsertRangeCore(index, src, from); }
  34. public void AddRange(T[] src, int from, int count) { AddRangeCore(src, from, count); }
  35. public void InsertRange(int index, T[] src, int from, int count) { InsertRangeCore(index, src, from, count); }
  36. //------------------------------------------------------------------------------------------
  37. public void Clear() { ClearCore(); }
  38. public bool Remove(T item) { return RemoveCore(item); }
  39. public void RemoveAt(int index) { RemoveAtCore(index); }
  40. public void RemoveRange(int from, int count) { RemoveRangeCore(from, count); }
  41. //------------------------------------------------------------------------------------------
  42. public T Move(int from, int to) { return MoveCore(from, to); }
  43. public int SetIndex(T item, int to) { return SetIndexCore(item, to); }
  44. public int MoveRelative(T item, int move) { return MoveRelativeCore(item, move); }
  45. public void Swap(int a, int b) { SwapCore(a, b); }
  46. //------------------------------------------------------------------------------------------
  47. public bool Contains(T item) { return ContainsCore(item); }
  48. //------------------------------------------------------------------------------------------
  49. public int IndexOf(T item) { return IndexOfCore(item); }
  50. public int IndexOf(T item, int startIndex) { return IndexOfCore(item, startIndex); }
  51. public int IndexOf(T item, int startIndex, int count) { return IndexOfCore(item, startIndex, count); }
  52. //------------------------------------------------------------------------------------------
  53. public int LastIndexOf(T item) { return LastIndexOfCore(item); }
  54. public int LastIndexOf(T item, int startIndex) { return LastIndexOfCore(item, startIndex); }
  55. public int LastIndexOf(T item, int startIndex, int count) { return LastIndexOfCore(item, startIndex, count); }
  56. //------------------------------------------------------------------------------------------
  57. public void CopyTo(T[] array) { CopyToCore(array); }
  58. public void CopyTo(T[] array, int index) { CopyToCore(array, index); }
  59. public void CopyTo(Array array) { CopyToCore(array); }
  60. public void CopyTo(Array array, int index) { CopyToCore(array, index); }
  61. public T[] ToArray() { T[] array = new T[Count]; CopyToCore(array); return array; }
  62. public T[] SubArray(int from, int count) { return SubArrayCore(from, count); }
  63. //------------------------------------------------------------------------------------------
  64. public void Sort() { SortCore(); }
  65. public void Sort(IComparer<T> cmp) { SortCore(cmp); }
  66. public void Sort(int from, int count) { SortCore(from, count); }
  67. public void Sort(int from, int count, IComparer<T> cmp) { SortCore(from, count, cmp); }
  68. //------------------------------------------------------------------------------------------
  69. public void Reverse() { ReverseCore(); }
  70. //------------------------------------------------------------------------------------------
  71. IEnumerator IEnumerable.GetEnumerator() { return GetEnumeratorCore(); }
  72. bool ICollection.IsSynchronized { get { return false; } }
  73. object ICollection.SyncRoot { get { return this; } }
  74. bool IList.IsFixedSize { get { return false; } }
  75. bool IList.IsReadOnly { get { return false; } }
  76. bool ICollection<T>.IsReadOnly { get { return false; } }
  77. //------------------------------------------------------------------------------------------
  78. int IList.Add(object item) { Verify(item); int i = size; Add((T)item); return i; }
  79. bool IList.Contains(object item) { return IsGood(item) && Contains((T)item); }
  80. int IList.IndexOf(object item) { return IsGood(item) ? IndexOf((T)item) : -1; }
  81. void IList.Insert(int index, object item) { Verify(item); Insert(index, (T)item); }
  82. void IList.Remove(object item) { if(IsGood(item)) Remove((T)item); }
  83. //------------------------------------------------------------------------------------------
  84. object IList.this[int index] {
  85.     get { return GetCore(index); }
  86.     set { Verify(value); this[index] = (T)value; } }
  87. //------------------------------------------------------------------------------------------
  88. void IFireList.Sort(IComparer cmp) { items.Sort(0, size, cmp); }
  89. object IFireList.Move(int from, int to) { return Move(from, to); }
  90. //##################################################################################################
  91. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement