using System;
using System.Collections;
using System.Runtime.InteropServices;
namespace System.ComponentModel
{
/// Provides a read-only container for a collection of objects.
// Token: 0x02000065 RID: 101
[ComVisible(true)]
public class ComponentCollection : ReadOnlyCollectionBase
{
/// Initializes a new instance of the class using the specified array of components.
/// An array of objects to initialize the collection with.
// Token: 0x060003CB RID: 971 RVA: 0x0000B908 File Offset: 0x00009B08
public ComponentCollection(IComponent[] components)
{
base.InnerList.AddRange(components);
}
/// Gets the in the collection at the specified collection index.
/// The at the specified index.
/// The collection index of the to get.
/// If the specified index is not within the index range of the collection.
// Token: 0x1700010D RID: 269
public virtual IComponent this[int index]
{
get
{
return (IComponent)base.InnerList[index];
}
}
/// Gets any component in the collection matching the specified name.
/// A component with a name matching the name specified by the parameter, or null if the named component cannot be found in the collection.
/// The name of the to get.
// Token: 0x1700010E RID: 270
public virtual IComponent this[string name]
{
get
{
foreach (object obj in base.InnerList)
{
IComponent component = (IComponent)obj;
if (component.Site != null && component.Site.Name == name)
{
return component;
}
}
return null;
}
}
/// Copies the entire collection to an array, starting writing at the specified array index.
/// An array to copy the objects in the collection to.
/// The index of the at which copying to should begin.
// Token: 0x060003CE RID: 974 RVA: 0x0000B9C4 File Offset: 0x00009BC4
public void CopyTo(IComponent[] array, int index)
{
base.InnerList.CopyTo(array, index);
}
}
}