Installer.Installers Właściwość

Definicja

Pobiera kolekcję instalatorów, które zawiera ten instalator.

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

Wartość właściwości

Element InstallerCollection zawierający kolekcję instalatorów skojarzonych z tym instalatorem.

Atrybuty

Przykłady

W poniższym przykładzie przedstawiono Installers właściwości i Parent . Właściwość Installers pokazuje skojarzona InstallerCollection z elementem 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

Uwagi

Właściwość Installers zawiera kolekcję instalatorów, które instalują obiekty wymagane przez to Installer wystąpienie do poprawnego zainstalowania składnika. Metody Install, Commit, Rollbacki Uninstall klasy Installer przechodzą przez kolekcję instalatorów i wywołuje odpowiednią metodę każdego instalatora.

Jeśli to wystąpienie znajduje Installer się w kolekcji instalatora, Parent właściwość jest Installer wystąpieniem zawierającym kolekcję. Przykład użycia Installers kolekcji można znaleźć w AssemblyInstaller klasie .

Dotyczy

Zobacz też