InstallerCollection.Contains メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > InstallerCollection.Contains メソッドの意味・解説 

InstallerCollection.Contains メソッド

指定したインストーラコレクション内にあるかどうか確認します

名前空間: System.Configuration.Install
アセンブリ: System.Configuration.Install (system.configuration.install.dll 内)
構文構文

使用例使用例

InstallerCollection クラスRemove メソッドContains メソッド、および IndexOf メソッドの例を次に示します。これは MyAssembly1.exe および MyAssembly2.exe の AssemblyInstaller インスタンス作成します。これらのインスタンスは、TransactedInstaller に追加されます。MyAssembly2.exe次にTransactedInstallerInstallerCollection から削除されます。インストール プロセス開始されMyAssembly1.exe だけをインストールます。

Dim myTransactedInstaller As New
 TransactedInstaller()
Dim myAssemblyInstaller1 As AssemblyInstaller
Dim myAssemblyInstaller2 As AssemblyInstaller
Dim myInstallContext As InstallContext

' Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
myAssemblyInstaller1 = New AssemblyInstaller("MyAssembly1.exe",
 Nothing)

' Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller.Installers.Insert(0, myAssemblyInstaller1)

' Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
myAssemblyInstaller2 = New AssemblyInstaller("MyAssembly2.exe",
 Nothing)

' Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller.Installers.Insert(1, myAssemblyInstaller2)

' Remove the 'myAssemblyInstaller2' from the 'Installers' collection.
If myTransactedInstaller.Installers.Contains(myAssemblyInstaller2)
 Then
   Console.WriteLine(ControlChars.Newline + "Installer at index
 : {0} is being removed", _
                     myTransactedInstaller.Installers.IndexOf(myAssemblyInstaller2))
   myTransactedInstaller.Installers.Remove(myAssemblyInstaller2)
End If
TransactedInstaller myTransactedInstaller = new TransactedInstaller();
AssemblyInstaller myAssemblyInstaller1;
AssemblyInstaller myAssemblyInstaller2;
InstallContext myInstallContext;

// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
myAssemblyInstaller1 = 
   new AssemblyInstaller("MyAssembly1.exe", null);

// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller.Installers.Insert(0, myAssemblyInstaller1);

// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
myAssemblyInstaller2 = 
   new AssemblyInstaller("MyAssembly2.exe", null);

// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller.Installers.Insert(1, myAssemblyInstaller2);

// Remove the 'myAssemblyInstaller2' from the 'Installers' collection.
if(myTransactedInstaller.Installers.Contains(myAssemblyInstaller2))
{
   Console.WriteLine("\nInstaller at index : {0} is being removed",
      myTransactedInstaller.Installers.IndexOf(myAssemblyInstaller2));
   myTransactedInstaller.Installers.Remove(myAssemblyInstaller2);
}
TransactedInstaller^ myTransactedInstaller = gcnew TransactedInstaller;
AssemblyInstaller^ myAssemblyInstaller1;
AssemblyInstaller^ myAssemblyInstaller2;
InstallContext^ myInstallContext;

// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
myAssemblyInstaller1 = gcnew AssemblyInstaller( "MyAssembly1.exe",nullptr
 );

// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller->Installers->Insert( 0, myAssemblyInstaller1 );

// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
myAssemblyInstaller2 = gcnew AssemblyInstaller( "MyAssembly2.exe",nullptr
 );

// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller->Installers->Insert( 1, myAssemblyInstaller2 );

// Remove the 'myAssemblyInstaller2' from the 'Installers' collection.
if ( myTransactedInstaller->Installers->Contains( myAssemblyInstaller2
 ) )
{
   Console::WriteLine( "\nInstaller at index : {0} is being removed", myTransactedInstaller->Installers->IndexOf(
 myAssemblyInstaller2 ) );
   myTransactedInstaller->Installers->Remove( myAssemblyInstaller2 );
}
TransactedInstaller myTransactedInstaller 
    = new TransactedInstaller();
AssemblyInstaller myAssemblyInstaller1;
AssemblyInstaller myAssemblyInstaller2;
InstallContext myInstallContext;

// Create a instance of 'AssemblyInstaller' 
//that installs 'MyAssembly1.exe'.
myAssemblyInstaller1 
    = new AssemblyInstaller("MyAssembly1.exe", null);

// Add the instance of 'AssemblyInstaller' to 
//the 'TransactedInstaller'.
myTransactedInstaller.get_Installers().
    Insert(0, myAssemblyInstaller1);

// Create a instance of 'AssemblyInstaller' that 
//installs 'MyAssembly2.exe'.
myAssemblyInstaller2 
    = new AssemblyInstaller("MyAssembly2.exe", null);

// Add the instance of 'AssemblyInstaller' to 
// the 'TransactedInstaller'.
myTransactedInstaller.get_Installers().
    Insert(1, myAssemblyInstaller2);

// Remove the 'myAssemblyInstaller2' from the 
//'Installers' collection.
if (myTransactedInstaller.get_Installers().
    Contains(myAssemblyInstaller2)) {
    Console.WriteLine("\nInstaller at index : {0} is being removed",
        System.Convert.ToString(
        myTransactedInstaller.get_Installers().
        IndexOf(myAssemblyInstaller2)));
    myTransactedInstaller.get_Installers().
        Remove(myAssemblyInstaller2);
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
InstallerCollection クラス
InstallerCollection メンバ
System.Configuration.Install 名前空間
Add
AddRange
Remove
Installer クラス


このページでは「.NET Framework クラス ライブラリ リファレンス」からInstallerCollection.Contains メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からInstallerCollection.Contains メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からInstallerCollection.Contains メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

InstallerCollection.Contains メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



InstallerCollection.Contains メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS