Installer.Installers 屬性

定義

取得這個安裝程式包含的安裝程式集合。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

屬性值

InstallerCollection,含有與這個安裝程式相關聯的安裝程式集合。An InstallerCollection containing the collection of installers associated with this installer.

屬性

範例

下列範例示範InstallersParent屬性。The following example demonstrates the Installers and Parent properties. 屬性會顯示與InstallerCollection Installer相關聯的。 InstallersThe 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

備註

屬性包含安裝程式的集合, 其會安裝這個Installer實例所需的物件, 以正確安裝元件。 InstallersThe Installers property contains a collection of installers that install objects needed by this Installer instance to correctly install the component. 類別的InstallerCommitRollbackUninstall方法會經歷安裝程式的集合, 並叫用每個安裝程式的對應方法。 InstallThe Install, Commit, Rollback, and Uninstall methods of the Installer class go through the collection of installers and invokes the corresponding method of each installer.

如果的Installer這個實例包含在安裝程式集合中, 則Parent屬性會是Installer包含集合的實例。If this instance of Installer is contained in an installer collection, the Parent property is the Installer instance that contains the collection. 如需使用Installers集合的範例, AssemblyInstaller請參閱類別。For an example of the use of the Installers collection, see the AssemblyInstaller class.

適用於

另請參閱