Installer.Parent 屬性

定義

取得或設定安裝程式,含有這個安裝程式所屬的集合。Gets or sets the installer containing the collection that this installer belongs to.

public:
 property System::Configuration::Install::Installer ^ Parent { System::Configuration::Install::Installer ^ get(); void set(System::Configuration::Install::Installer ^ value); };
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.TypeConverter("System.Configuration.Design.InstallerParentConverter")]
public System.Configuration.Install.Installer Parent { get; set; }
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.TypeConverter(typeof(System.Configuration.Install.InstallerParentConverter))]
public System.Configuration.Install.Installer Parent { get; set; }
public System.Configuration.Install.Installer Parent { get; set; }
member this.Parent : System.Configuration.Install.Installer with get, set
Public Property Parent As Installer

屬性值

Installer,含有這個執行個體所屬的集合,或 null (如果這個執行個體不屬於集合)。An Installer containing the collection that this instance belongs to, or null if this instance does not belong to a collection.

屬性

範例

下列範例會示範Parent屬性。The following example demonstrates the Parent property. 屬性會取得包含這個Installer所屬之集合的。 Installer ParentThe Parent property gets the Installer containing the collection that this Installer belongs to.

AssemblyInstaller^ myAssemblyInstaller1 = gcnew AssemblyInstaller;
InstallerCollection^ myInstallerCollection1 = myAssemblyInstaller1->Installers;
// 'myAssemblyInstaller' is an installer of type 'AssemblyInstaller'.
myInstallerCollection1->Add( myAssemblyInstaller );

Installer^ myInstaller1 = myAssemblyInstaller->Parent;
Console::WriteLine( "Parent of myAssembly : {0}", myInstaller1 );
AssemblyInstaller myAssemblyInstaller1 = new AssemblyInstaller();
InstallerCollection myInstallerCollection1 = myAssemblyInstaller1.Installers;
// 'myAssemblyInstaller' is an installer of type 'AssemblyInstaller'.
myInstallerCollection1.Add(myAssemblyInstaller);

Installer myInstaller1 = myAssemblyInstaller.Parent;
Console.WriteLine("Parent of myAssembly : {0}", myInstaller1.ToString());
Dim myAssemblyInstaller1 As New AssemblyInstaller()
Dim myInstallerCollection1 As InstallerCollection = _
                                      myAssemblyInstaller1.Installers
' 'myAssemblyInstaller' is an installer of type 'AssemblyInstaller'.
myInstallerCollection1.Add(myAssemblyInstaller)

Dim myInstaller1 As Installer = myAssemblyInstaller.Parent
Console.WriteLine("Parent of myAssembly : {0}", myInstaller1.ToString())

備註

如果的Installer這個實例是安裝程式集合的一部分, 則Parent會將Installer屬性設定為包含集合的實例。If this instance of Installer is part of an installer collection, the Parent property is set to the Installer instance that contains the collection. 如需使用Installers集合的範例, AssemblyInstaller請參閱類別。For an example of the use of the Installers collection, see the AssemblyInstaller class.

Installers屬性包含安裝程式的集合。The Installers property contains a collection of installers. 類別的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.

適用於

另請參閱