Foley.Utilities.Collections
Interface IList2

Represents an enhanced version of the System.Collections.IList interface.

Method Summary
bool Add(System.Collections.ICollection collection)
         When implemented by a class, adds the elements of the specified System.Collections.ICollection to the end of the list.
bool Contains(System.Collections.ICollection collection)
         When implemented by a class, determines whether all the elements in the specified collection are contained in the System.Collections.IList contains.
System.Collections.IEnumerator GetEnumerator(int index)
         When implemented by a class, returns an System.Collections.IEnumerator that can iterate through the list that starts at the specified position.
bool Insert(int index, System.Collections.ICollection collection)
         When implemented by a class, inserts the elements of the System.Collections.ICollection to the list at the specified position.
bool Insert(int index, object value)
         When implemented by a class, inserts an object to the list at the specified position.
int LastIndexOf(object value)
         When implemented by a class, determines the index of the last occurrence of the specific object in the list.
bool Remove(System.Collections.ICollection collection)
         When implemented by a class, removes the first occurrence of each element of the specified System.Collections.ICollection from the list.
bool Remove(int index, int count)
         When implemented by a class, removes the specified number of the elements starting at the position specified.
bool Remove(object value)
         When implemented by a class, removes the first occurrence of a specific object from the list.
bool RemoveAt(int index)
         When implemented by a class, removes the element at the specified position from the list.
bool Retain(System.Collections.ICollection collection)
         When implemented by a class, retains the first occurrence of each element of the specified System.Collections.ICollection from the list.
System.Collections.IList SubList(int index, int count)
         When implemented by a class, provides a view of the list with the specified number of the elements starting at the position specified.


Method Detail

Add

public bool Add(System.Collections.ICollection collection)

When implemented by a class, adds the elements of the specified System.Collections.ICollection to the end of the list.

Parameters:
collection - The System.Collections.ICollection whose elements are to be added to the list.
Returns:
true if the list is modified; otherwise false.
Throws:
System.NotSupportedException -

The list is read-only.

-or-

The list has a fixed size.


Contains

public bool Contains(System.Collections.ICollection collection)

When implemented by a class, determines whether all the elements in the specified collection are contained in the System.Collections.IList contains.

Parameters:
collection - The System.Collections.ICollection whose elements are to be added to the end of the list.
Returns:
true if all the elements of the System.Collections.ICollection are found in the list; otherwise, false.

GetEnumerator

public System.Collections.IEnumerator GetEnumerator(int index)

When implemented by a class, returns an System.Collections.IEnumerator that can iterate through the list that starts at the specified position.

Parameters:
index - Starting index in the list for the begining of the System.Collections.IEnumerator.
Returns:
An System.Collections.IEnumerator that can be used to iterate through the list.

Insert

public bool Insert(int index,
                   System.Collections.ICollection collection)

When implemented by a class, inserts the elements of the System.Collections.ICollection to the list at the specified position.

Parameters:
index - The zero-based index at which collection should be inserted.
collection - The System.Collections.ICollection whose elements are to be added to the list.
Returns:
true if the list is modified; otherwise false.
Throws:
System.NotSupportedException -

The list is read-only.

-or-

The list has a fixed size.


Insert

public bool Insert(int index,
                   object value)

When implemented by a class, inserts an object to the list at the specified position.

This method hides the System.Collections.IList method that returns void. You may want to do an explicit interface method implementation for the System.Collections.IList version to be completely compatible.

Parameters:
index - The zero-based index at which value should be inserted.
value - The object to insert into the list.
Returns:
true if the list is modified; otherwise false.
Throws:
System.NotSupportedException -

The list is read-only.

-or-

The list has a fixed size.


LastIndexOf

public int LastIndexOf(object value)

When implemented by a class, determines the index of the last occurrence of the specific object in the list.

Parameters:
value - The object to locate in the list.
Returns:
The index of the last occurrence of the value if found in the list; otherwise, -1.

Remove

public bool Remove(System.Collections.ICollection collection)

When implemented by a class, removes the first occurrence of each element of the specified System.Collections.ICollection from the list.

Parameters:
collection - The System.Collections.ICollection used to determine what elements to remove from the list.
Returns:
true if the list is modified; otherwise false.
Throws:
System.NotSupportedException -

The list is read-only.

-or-

The list has a fixed size.


Remove

public bool Remove(int index,
                   int count)

When implemented by a class, removes the specified number of the elements starting at the position specified.

Parameters:
index - Starting index for removing elements from the list.
count - The number of elements to remove from the list.
Returns:
true if the list is modified; otherwise false.
Throws:
System.NotSupportedException -

The list is read-only.

-or-

The list has a fixed size.


Remove

public bool Remove(object value)

When implemented by a class, removes the first occurrence of a specific object from the list.

This method hides the System.Collections.IList method that returns void. You may want to do an explicit interface method implementation for the System.Collections.IList version to be completely compatible.

Parameters:
value - The object to remove from the list.
Returns:
true if the list is modified; otherwise false.
Throws:
System.NotSupportedException -

The list is read-only.

-or-

The list has a fixed size.


RemoveAt

public bool RemoveAt(int index)

When implemented by a class, removes the element at the specified position from the list.

Parameters:
index - The index of the element to remove from the list.
Returns:
true if the list is modified; otherwise false.
Throws:
System.NotSupportedException -

The list is read-only.

-or-

The list has a fixed size.


Retain

public bool Retain(System.Collections.ICollection collection)

When implemented by a class, retains the first occurrence of each element of the specified System.Collections.ICollection from the list.

Parameters:
collection - The System.Collections.ICollection used to determine what elements to be retained in the list.
Returns:
true if the list is modified; otherwise false.
Throws:
System.NotSupportedException -

The list is read-only.

-or-

The list has a fixed size.


SubList

public System.Collections.IList SubList(int index,
                                        int count)

When implemented by a class, provides a view of the list with the specified number of the elements starting at the position specified.

The list that is returned is just a view, it is still backed by the orignal list. Any changes you make to it will be reflected in the orignal list.

Parameters:
index - Starting index for the view of elements from the list.
count - The number of elements to include in the view of the list.
Returns:
A view of list.