InstallerCollection.Remove Method (Installer)


Removes the specified Installer from the collection.

Namespace:   System.Configuration.Install
Assembly:  System.Configuration.Install (in System.Configuration.Install.dll)

public void Remove(
	Installer value


Type: System.Configuration.Install.Installer

An Installer that represents the installer to remove.

The Parent property of the removed Installer is set to null.

The following example is the same as the example in the Contains method. For more information on this example, please see the Example section of the Contains method.

TransactedInstaller myTransactedInstaller = new TransactedInstaller();
AssemblyInstaller myAssemblyInstaller1;
AssemblyInstaller myAssemblyInstaller2;
InstallContext myInstallContext;

// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
myAssemblyInstaller1 = 
   new AssemblyInstaller("MyAssembly1.exe", null);

// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller.Installers.Insert(0, myAssemblyInstaller1);

// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
myAssemblyInstaller2 = 
   new AssemblyInstaller("MyAssembly2.exe", null);

// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller.Installers.Insert(1, myAssemblyInstaller2);

// Remove the 'myAssemblyInstaller2' from the 'Installers' collection.
   Console.WriteLine("\nInstaller at index : {0} is being removed",

.NET Framework
Available since 1.1
Return to top