private int[] Find(string propertyName, object key, bool getFirst) { GDAList <int> itens = new GDAList <int>(); Type type = typeof(T); int count = 0; foreach (T o in this) { if (Match(type.GetProperty(propertyName).GetValue(o, null), key)) { if (getFirst) { return new int[] { count } } ; else { itens.Add(count); } } count++; } if (getFirst) { return(null); } else { return(itens.ToArray()); } }
void IList.Remove(object item) { if (GDAList <T> .IsCompatibleObject(item)) { this.Remove((T)item); } }
internal Enumerator(GDAList <T> list) { this.list = list; this.index = 0; this.version = list._version; this.current = default(T); }
private static void VerifyValueType(object value) { if (!GDAList <T> .IsCompatibleObject(value)) { throw new ArgumentException(); } }
int IList.Add(object item) { GDAList <T> .VerifyValueType(item); this.Add((T)item); return(this.Count - 1); }
int IList.IndexOf(object item) { if (GDAList <T> .IsCompatibleObject(item)) { return(this.IndexOf((T)item)); } return(-1); }
bool IList.Contains(object item) { if (GDAList <T> .IsCompatibleObject(item)) { return(this.Contains((T)item)); } return(false); }
object IList.this[int index] { get { return(this[index]); } set { GDAList <T> .VerifyValueType(value); this[index] = (T)value; } }
public GDAList <TOutput> ConvertAll <TOutput>(Converter <T, TOutput> converter) { if (converter == null) { throw new ArgumentNullException("converter"); } GDAList <TOutput> list = new GDAList <TOutput>(this._size); for (int i = 0; i < this._size; i++) { list._items[i] = converter(this._items[i]); } list._size = this._size; return(list); }
public GDAList <T> GetRange(int index, int count) { if ((index < 0) || (count < 0)) { throw new ArgumentOutOfRangeException((index < 0) ? "index" : "count", "ArgumentOutOfRange_NeedNonNegNum"); } if ((this._size - index) < count) { throw new ArgumentException("Argument_InvalidOffLen"); } GDAList <T> list = new GDAList <T>(count); Array.Copy(this._items, index, list._items, 0, count); list._size = count; return(list); }
public GDAList <T> FindAll(Predicate <T> match) { if (match == null) { throw new ArgumentNullException("match"); } GDAList <T> list = new GDAList <T>(); for (int i = 0; i < this._size; i++) { if (match(this._items[i])) { list.Add(this._items[i]); } } return(list); }
void IList.Insert(int index, object item) { GDAList <T> .VerifyValueType(item); this.Insert(index, (T)item); }