1 // InstallerCollection.cs
2 // System.Configuration.Install.InstallerCollection class implementation
5 // Muthu Kannan (t.manki@gmail.com)
7 // (C) 2005 Novell, Inc. http://www.novell.com/
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Collections;
33 namespace System.Configuration.Install
36 public class InstallerCollection : CollectionBase {
37 private Installer parent;
40 internal InstallerCollection (Installer parent)
46 public Installer this [int index] {
48 return (Installer)List [index];
56 public int Add (Installer installer)
58 return List.Add (installer);
61 public void AddRange (Installer [] installers)
63 foreach (Installer ins in installers)
67 public void AddRange (InstallerCollection installers)
69 foreach (Installer ins in installers)
73 public bool Contains (Installer installer)
75 return List.Contains (installer);
78 public void CopyTo (Installer [] array, int index)
80 List.CopyTo (array, index);
83 public int IndexOf (Installer installer)
85 return List.IndexOf (installer);
88 public void Insert (int index, Installer installer)
90 List.Insert (index, installer);
93 public void Remove (Installer installer)
95 List.Remove (installer);
98 protected override void OnInsert (int index, object val)
100 ((Installer)val).Parent = parent;
103 protected override void OnRemove (int index, object val)
105 ((Installer)val).Parent = null;
108 protected override void OnSet (int index, object oldVal, object newVal)
110 ((Installer)oldVal).Parent = null;
111 ((Installer)newVal).Parent = parent;