Export (0) Print
Expand All

Installer.Parent Property

Gets or sets the installer containing the collection that this installer belongs to.

[Visual Basic]
Public Property Parent As Installer
[C#]
public Installer Parent {get; set;}
[C++]
public: __property Installer* get_Parent();
public: __property void set_Parent(Installer*);
[JScript]
public function get Parent() : Installer;
public function set Parent(Installer);

Property Value

An Installer containing the collection that this instance belongs to, or a null reference (Nothing in Visual Basic) if this instance does not belong to a collection.

Remarks

If this instance of Installer is part of an installer collection, the Parent property is set to the Installer instance that contains the collection. For an example of the use of the Installers collection, see the AssemblyInstaller class.

The Installers property contains a collection of installers. The Install, Commit, Rollback, and Uninstall methods of the Installer class go through the collection of installers and invokes the corresponding method of each installer.

Example

[Visual Basic, C#, C++] The following example demonstrates the Parent property. The Parent property gets the Installer containing the collection that this Installer belongs to.

[Visual Basic] 
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())

[C#] 
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());

[C++] 
AssemblyInstaller* myAssemblyInstaller1 = new AssemblyInstaller();
InstallerCollection* myInstallerCollection1 = myAssemblyInstaller1->Installers;
// 'myAssemblyInstaller' is an installer of type 'AssemblyInstaller'.
myInstallerCollection1->Add(myAssemblyInstaller);

Installer* myInstaller1 = myAssemblyInstaller->Parent;
Console::WriteLine(S"Parent of myAssembly : {0}", myInstaller1);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

Installer Class | Installer Members | System.Configuration.Install Namespace | Commit | Install | InstallerCollection | Installers | Rollback | Uninstall

Show:
© 2014 Microsoft