共用方式為


Installer.Parent 屬性

定義

取得或設定安裝程式,含有這個安裝程式所屬的集合。

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; }
[<System.ComponentModel.Browsable(true)>]
[<System.ComponentModel.TypeConverter("System.Configuration.Design.InstallerParentConverter")>]
member this.Parent : System.Configuration.Install.Installer with get, set
[<System.ComponentModel.Browsable(true)>]
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.Install.InstallerParentConverter))>]
member this.Parent : System.Configuration.Install.Installer with get, set
Public Property Parent As Installer

屬性值

Installer,包含這個執行個體所屬的集合;如果這個執行個體不屬於集合,則為 null

屬性

範例

下列範例示範 Parent 屬性。 屬性 Parent 會取得 , Installer 其中包含這個 Installer 所屬的集合。

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 包含集合的實例。 如需使用集合的 Installers 範例,請參閱 AssemblyInstaller 類別。

屬性 Installers 包含安裝程式的集合。 類別InstallInstallerRollbackCommitUninstall 方法會經歷安裝程式的集合,並叫用每個安裝程序的對應方法。

適用於

另請參閱