Language

ComponentInstaller.IsEquivalentInstaller(ComponentInstaller) メソッド

定義

指定したインストーラーがこのインストーラーと同じオブジェクトをインストールするかどうかを判断します。

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

パラメーター

otherInstaller
ComponentInstaller

比較するインストーラー。

返品

true このインストーラーと otherInstaller パラメーターで指定されたインストーラーが同じオブジェクトをインストールする場合は。それ以外の場合は false。

例

次の例では、イベント ログを作成し、イベント ログ コンポーネントのプロパティを MyInstallClass オブジェクトにコピーするクラス EventLogInstallerを定義します。 また、 ServiceInstaller オブジェクトが 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

注釈

通常、IsEquivalentInstallerは、このインストーラーと true パラメーターで指定されたインストーラーが同じオブジェクトをインストールする場合にのみ、otherInstallerを返します。 このような場合、いずれかのインストーラーで Install または Uninstall メソッドを呼び出すと、同じシステム状態になります。

適用対象