ComponentInstaller.IsEquivalentInstaller(ComponentInstaller) Metoda

Definice

Určuje, jestli zadaný instalační program nainstaluje stejný objekt jako tento instalační program.

public:
 virtual bool IsEquivalentInstaller(System::Configuration::Install::ComponentInstaller ^ otherInstaller);
public virtual bool IsEquivalentInstaller (System.Configuration.Install.ComponentInstaller otherInstaller);
abstract member IsEquivalentInstaller : System.Configuration.Install.ComponentInstaller -> bool
override this.IsEquivalentInstaller : System.Configuration.Install.ComponentInstaller -> bool
Public Overridable Function IsEquivalentInstaller (otherInstaller As ComponentInstaller) As Boolean

Parametry

otherInstaller
ComponentInstaller

Instalační program, který chcete porovnat.

Návraty

true pokud tento instalační program a instalační program určený parametrem otherInstaller nainstalujte stejný objekt, falsev opačném případě .

Příklady

Následující příklad definuje třídu MyInstallClass, která vytvoří protokol událostí a zkopíruje vlastnosti komponenty protokolu událostí do objektu EventLogInstaller . Také zkontroluje, jestli ServiceInstaller objekt dokáže zpracovat stejný druh instalace jako EventLogInstaller.

ServiceInstaller^ myServiceInstaller = gcnew ServiceInstaller;
// Check whether 'ServiceInstaller' object can handle the same
// kind of installation as 'EventLogInstaller' object.
if ( myEventLogInstaller->IsEquivalentInstaller( myServiceInstaller ) )
{
   Console::WriteLine( "'ServiceInstaller' can handle the same kind " +
      "of installation as EventLogInstaller" );
}
else
{
   Console::WriteLine( "'ServiceInstaller' can't handle the same " +
      "kind of installation as 'EventLogInstaller'" );
}
ServiceInstaller myServiceInstaller = new  ServiceInstaller();
// Check whether 'ServiceInstaller' object can handle the same
// kind of installation as 'EventLogInstaller' object.
if(myEventLogInstaller.IsEquivalentInstaller(myServiceInstaller))
{
   Console.WriteLine("'ServiceInstaller' can handle the same kind"
                     +" of installation as EventLogInstaller");
}
else
{
    Console.WriteLine("'ServiceInstaller' can't handle the same"
                 +" kind of installation as 'EventLogInstaller'");
}
Dim myServiceInstaller As New ServiceInstaller()
' Check whether 'ServiceInstaller' object can handle the same 
' kind of installation as 'EventLogInstaller' object.
If myEventLogInstaller.IsEquivalentInstaller(myServiceInstaller) Then
   Console.WriteLine("'ServiceInstaller' can handle the same kind" + _
                              " of installation as EventLogInstaller")
Else
   Console.WriteLine("'ServiceInstaller' can't handle the same" + _
                        " kind of installation as 'EventLogInstaller'")
End If

Poznámky

Obvykle vrátí true pouze v případě, IsEquivalentInstaller že tento instalační program a instalační program určený parametrem otherInstaller nainstaluje stejný objekt. V takovém případě volání Install metody nebo Uninstall v instalačním programu způsobí stejný stav systému.

Platí pro