/// <summary> /// Searches for a given item's <see cref="ObjectView<T>"/> wrapper, returning the index of the value in this list. /// </summary> /// <param name="item">The <see cref="ObjectView<T>"/> to search for.</param> /// <returns>Returns the index in this list of the item, or -1 if not found.</returns> public int IndexOfKey(ObjectView <T> item) { for (int i = 0; i < Count; i++) { if (this[i].Key.Item.Equals(item) && this[i].Value > -1) { return(i); } } return(-1); }
public void Add(IList sourceList, ObjectView <T> item, int index) { Add(new KeyValuePair <ListItemPair <T>, int>(new ListItemPair <T>(sourceList, item), index)); }
/// <summary> /// Checks if the list contains a given <see cref="ObjectView<T>"/> key. /// </summary> /// <param name="item">The key to search for.</param> /// <returns>True if the key is contained in the list, otherwise false.</returns> public bool ContainsKey(ObjectView <T> key) { return(IndexOfKey(key) != -1); }
public ListItemPair(IList list, ObjectView <T> item) { _list = list; _item = item; }