Aracılığıyla paylaş


ComponentInstaller.IsEquivalentInstaller(ComponentInstaller) Yöntem

Tanım

Belirtilen yükleyicinin bu yükleyiciyle aynı nesneyi yükleyip yüklemediğini belirler.

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

Parametreler

otherInstaller
ComponentInstaller

Karşılaştıracak yükleyici.

Döndürülenler

true bu yükleyici ve parametresi tarafından otherInstaller belirtilen yükleyici aynı nesneyi yüklerse; aksi takdirde , false.

Örnekler

Aşağıdaki örnek, olay günlüğünü oluşturan ve olay günlüğü bileşeninin özelliklerini nesnesine kopyalayan bir sınıfını MyInstallClassEventLogInstaller tanımlar. Ayrıca nesnenin ile aynı yükleme EventLogInstallertürünü işleyip ServiceInstaller işleyemeyeceğini de denetler.

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

Açıklamalar

Genellikle, IsEquivalentInstaller yalnızca bu yükleyici ve parametresi tarafından otherInstaller belirtilen yükleyici aynı nesneyi yüklerse döndürürtrue. Böyle bir durumda, yükleyicide Install veya Uninstall yönteminin çağrılması aynı sistem durumuna neden olur.

Şunlara uygulanır