mscorlib(4.0.0.0) API with additions
ComponentCollection.cs
1 using System.Collections;
4 
5 namespace System.ComponentModel
6 {
8  [ComVisible(true)]
9  [HostProtection(SecurityAction.LinkDemand, Synchronization = true)]
11  {
15  public virtual IComponent this[string name]
16  {
17  get
18  {
19  if (name != null)
20  {
21  IList innerList = base.InnerList;
22  foreach (IComponent item in innerList)
23  {
24  if (item != null && item.Site != null && item.Site.Name != null && string.Equals(item.Site.Name, name, StringComparison.OrdinalIgnoreCase))
25  {
26  return item;
27  }
28  }
29  }
30  return null;
31  }
32  }
33 
38  public virtual IComponent this[int index]
39  {
40  get
41  {
42  return (IComponent)base.InnerList[index];
43  }
44  }
45 
48  public ComponentCollection(IComponent[] components)
49  {
50  base.InnerList.AddRange(components);
51  }
52 
56  public void CopyTo(IComponent[] array, int index)
57  {
58  base.InnerList.CopyTo(array, index);
59  }
60  }
61 }
StringComparison
Specifies the culture, case, and sort rules to be used by certain overloads of the M:System....
Represents a non-generic collection of objects that can be individually accessed by index.
Definition: IList.cs:8
Definition: __Canon.cs:3
ComponentCollection(IComponent[] components)
Initializes a new instance of the T:System.ComponentModel.ComponentCollection class using the specifi...
Provides the abstract base class for a strongly typed non-generic read-only collection.
SecurityAction
Specifies the security actions that can be performed using declarative security.
void CopyTo(IComponent[] array, int index)
Copies the entire collection to an array, starting writing at the specified array index.
Provides functionality required by all components.
Definition: IComponent.cs:13
Provides a read-only container for a collection of T:System.ComponentModel.IComponent objects.