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; }
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
member this.Parent : System.Configuration.Install.Installer with get, set
Public Property Parent As Installer

属性值

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 属性包含安装程序的集合。 Install类的 InstallerCommitRollback方法和Uninstall方法将遍历安装程序的集合,并调用每个安装程序的相应方法。

适用于

另请参阅