New to Telerik UI for ASP.NET MVC? Start a free 30-day trial

Definition

Namespace:Kendo.Mvc

Assembly:Kendo.Mvc.dll

Type Parameters:

T

Syntax:

C#
public class LinkedObjectCollection<T> : IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable where T : LinkedObjectBase<T>

Inheritance: objectLinkedObjectCollection<T>

Implements: ICollection<T>IEnumerableIEnumerable<T>IList<T>

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the LinkedObjectCollection<T> class.

C#
public LinkedObjectCollection(T parent)
Parameters:parentT

The parent.

Properties

C#
public int Count { get; }

Implements: ICollection<T>.Count

C#
public bool IsReadOnly { get; }

Implements: ICollection<T>.IsReadOnly

Gets or sets the T object that is the parent of the current node.

C#
public T Parent { get; protected set; }
Property Value:

The parent.

C#
public T this[int index] { get; set; }
Parameters:indexint

Implements: IList<T>.this[int]

Methods

Adds an item to the ICollection<T>.

C#
public void Add(T item)
Parameters:itemT

The object to add to the ICollection<T>.

Exceptions: NotSupportedException

The ICollection<T> is read-only.

Implements: ICollection<T>.Add(T)

Removes all items from the ICollection<T>.

C#
public void Clear()
Exceptions: NotSupportedException

The ICollection<T> is read-only.

Implements: ICollection<T>.Clear()

Determines whether the ICollection<T> contains a specific value.

C#
public bool Contains(T item)
Parameters:itemT

The object to locate in the ICollection<T>.

Returns:

bool

true if item is found in the ICollection<T>; otherwise, false.

Implements: ICollection<T>.Contains(T)

Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

C#
public void CopyTo(T[] array, int arrayIndex)
Parameters:arrayT[]

The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.

arrayIndexint

The zero-based index in array at which copying begins.

Exceptions: ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is less than 0.

ArgumentException

array is multidimensional. -or- arrayIndex is equal to or greater than the length of array. -or- The number of elements in the source ICollection<T> is greater than the available space from arrayIndex to the end of the destination array. -or- Type cannot be cast automatically to the type of the destination array.

Implements: ICollection<T>.CopyTo(T[], int)

Returns an enumerator that iterates through the collection.

C#
public IEnumerator<T> GetEnumerator()
Returns:

IEnumerator<T>

A IEnumerator<T> that can be used to iterate through the collection.

Implements: IEnumerable<T>.GetEnumerator()

Determines the index of a specific item in the IList<T>.

C#
public int IndexOf(T item)
Parameters:itemT

The object to locate in the IList<T>.

Returns:

int

The index of item if found in the list; otherwise, -1.

Implements: IList<T>.IndexOf(T)

Inserts an item to the IList<T> at the specified index.

C#
public void Insert(int index, T item)
Parameters:indexint

The zero-based index at which item should be inserted.

itemT

The object to insert into the IList<T>.

Exceptions: ArgumentOutOfRangeException

index is not a valid index in the IList<T>.

NotSupportedException

The IList<T> is read-only.

Implements: IList<T>.Insert(int, T)

Removes the first occurrence of a specific object from the ICollection<T>.

C#
public bool Remove(T item)
Parameters:itemT

The object to remove from the ICollection<T>.

Returns:

bool

true if item was successfully removed from the ICollection<T>; otherwise, false. This method also returns false if item is not found in the original ICollection<T>.

Exceptions: NotSupportedException

The ICollection<T> is read-only.

Implements: ICollection<T>.Remove(T)

Removes the IList<T> item at the specified index.

C#
public void RemoveAt(int index)
Parameters:indexint

The zero-based index of the item to remove.

Exceptions: ArgumentOutOfRangeException

index is not a valid index in the IList<T>.

NotSupportedException

The IList<T> is read-only.

Implements: IList<T>.RemoveAt(int)