Installer.Installers Installer.Installers Installer.Installers Installer.Installers Property

Definizione

Ottiene l'insieme dei programmi di installazione contenuti nel programma.Gets the collection of installers that this installer contains.

public:
 property System::Configuration::Install::InstallerCollection ^ Installers { System::Configuration::Install::InstallerCollection ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Configuration.Install.InstallerCollection Installers { get; }
member this.Installers : System.Configuration.Install.InstallerCollection
Public ReadOnly Property Installers As InstallerCollection

Valore della proprietà

Oggetto InstallerCollection che contiene l'insieme dei programmi di installazione associati al programma.An InstallerCollection containing the collection of installers associated with this installer.

Esempi

Nell'esempio seguente vengono illustrate Parent le Installers proprietà e.The following example demonstrates the Installers and Parent properties. La Installers proprietà Mostra l' InstallerCollection oggetto associato a Installerun oggetto.The Installers property shows the InstallerCollection associated with an Installer.

AssemblyInstaller^ myAssemblyInstaller = gcnew AssemblyInstaller;
ServiceInstaller^ myServiceInstaller = gcnew ServiceInstaller;
EventLogInstaller^ myEventLogInstaller = gcnew EventLogInstaller;

InstallerCollection^ myInstallerCollection = myAssemblyInstaller->Installers;

// Add Installers to the InstallerCollection of 'myAssemblyInstaller'.
myInstallerCollection->Add( myServiceInstaller );
myInstallerCollection->Add( myEventLogInstaller );

array<Installer^>^ myInstaller = gcnew array<Installer^>(2);
myInstallerCollection->CopyTo( myInstaller, 0 );
// Show the contents of the InstallerCollection of 'myAssemblyInstaller'.
Console::WriteLine( "Installers in the InstallerCollection : " );
for ( int iIndex = 0; iIndex < myInstaller->Length; iIndex++ )
   Console::WriteLine( myInstaller[ iIndex ]->ToString() );
AssemblyInstaller myAssemblyInstaller = new AssemblyInstaller();
ServiceInstaller myServiceInstaller = new ServiceInstaller();
EventLogInstaller myEventLogInstaller = new EventLogInstaller();

InstallerCollection myInstallerCollection = myAssemblyInstaller.Installers;

// Add Installers to the InstallerCollection of 'myAssemblyInstaller'.
myInstallerCollection.Add(myServiceInstaller);
myInstallerCollection.Add(myEventLogInstaller);

Installer[] myInstaller = new Installer[2];
myInstallerCollection.CopyTo(myInstaller,0);
// Show the contents of the InstallerCollection of 'myAssemblyInstaller'.
Console.WriteLine("Installers in the InstallerCollection : ");
for (int iIndex=0; iIndex < myInstaller.Length; iIndex++)
   Console.WriteLine(myInstaller[iIndex].ToString());
Dim myAssemblyInstaller As New AssemblyInstaller()
Dim myServiceInstaller As New ServiceInstaller()
Dim myEventLogInstaller As New EventLogInstaller()
Dim myInstallerCollection As InstallerCollection = _
                                       myAssemblyInstaller.Installers

' Add Installers to the InstallerCollection of 'myAssemblyInstaller'.
myInstallerCollection.Add(myServiceInstaller)
myInstallerCollection.Add(myEventLogInstaller)

Dim myInstaller(1) As Installer
myInstallerCollection.CopyTo(myInstaller, 0)
' Show the contents of the InstallerCollection of 'myAssemblyInstaller'.
Console.WriteLine("Installers in the InstallerCollection : ")
Dim iIndex As Integer
For iIndex = 0 To myInstaller.Length - 1
   Console.WriteLine(myInstaller(iIndex).ToString())
Next iIndex

Commenti

La Installers proprietà contiene una raccolta di programmi di installazione che installano gli oggetti Installer necessari a questa istanza per installare correttamente il componente.The Installers property contains a collection of installers that install objects needed by this Installer instance to correctly install the component. I Installmetodi Commit, ,Rollback eUninstall della classeInstaller passano attraverso la raccolta di programmi di installazione e richiama il metodo corrispondente di ogni programma di installazione.The Install, Commit, Rollback, and Uninstall methods of the Installer class go through the collection of installers and invokes the corresponding method of each installer.

Se questa istanza di Installer è contenuta in una raccolta di programma Parent di installazione, Installer la proprietà è l'istanza di che contiene la raccolta.If this instance of Installer is contained in an installer collection, the Parent property is the Installer instance that contains the collection. Per un esempio dell'uso della Installers raccolta, vedere la AssemblyInstaller classe.For an example of the use of the Installers collection, see the AssemblyInstaller class.

Si applica a

Vedi anche