指定したインストーラ配列をコレクションに追加します。
Overloads Public Sub AddRange( _
ByVal value() As Installer _)
[C#]
public void AddRange(Installer[] value);
[C++]
public: void AddRange(Installer* value[]);
[JScript]
public function AddRange(
value : Installer[]);
パラメータ
- value
コレクションに追加するインストーラを表す Installer 型の配列。
解説
追加された各 Installer の Parent プロパティには、追加先のコレクションを格納している Installer が設定されます。
使用例
[Visual Basic, C#, C++] InstallerCollection クラスの AddRange メソッドの例を次に示します。この例では、 MyAssembly1.exe
および MyAssembly2.exe
の AssemblyInstaller インスタンスを作成します。これらのインスタンスは、 TransactedInstaller に追加されます。インストール プロセスによって、 MyAssembly1.exe
と MyAssembly2.exe
の両方がインストールされます。
Dim myInstallers As New ArrayList()
Dim myTransactedInstaller As New TransactedInstaller()
Dim myAssemblyInstaller As AssemblyInstaller
Dim myInstallContext As InstallContext
' Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
myAssemblyInstaller = New AssemblyInstaller("MyAssembly1.exe", Nothing)
' Add the instance of 'AssemblyInstaller' to the list of installers.
myInstallers.Add(myAssemblyInstaller)
' Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
myAssemblyInstaller = New AssemblyInstaller("MyAssembly2.exe", Nothing)
' Add the instance of 'AssemblyInstaller' to the list of installers.
myInstallers.Add(myAssemblyInstaller)
' Add the installers to the 'TransactedInstaller' instance.
myTransactedInstaller.Installers.AddRange(CType(myInstallers.ToArray(GetType(Installer)), _
Installer()))
[C#]
ArrayList myInstallers =new ArrayList();
TransactedInstaller myTransactedInstaller = new TransactedInstaller();
AssemblyInstaller myAssemblyInstaller;
InstallContext myInstallContext;
// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
myAssemblyInstaller =
new AssemblyInstaller("MyAssembly1.exe", null);
// Add the instance of 'AssemblyInstaller' to the list of installers.
myInstallers.Add(myAssemblyInstaller);
// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
myAssemblyInstaller =
new AssemblyInstaller("MyAssembly2.exe", null);
// Add the instance of 'AssemblyInstaller' to the list of installers.
myInstallers.Add(myAssemblyInstaller);
// Add the installers to the 'TransactedInstaller' instance.
myTransactedInstaller.Installers.AddRange((Installer[])myInstallers.ToArray(typeof(Installer)));
[C++]
ArrayList* myInstallers = new ArrayList();
TransactedInstaller* myTransactedInstaller = new TransactedInstaller();
AssemblyInstaller* myAssemblyInstaller;
InstallContext* myInstallContext;
// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
myAssemblyInstaller = new AssemblyInstaller(S"MyAssembly1.exe", 0);
// Add the instance of 'AssemblyInstaller' to the list of installers.
myInstallers->Add(myAssemblyInstaller);
// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
myAssemblyInstaller = new AssemblyInstaller(S"MyAssembly2.exe", 0);
// Add the instance of 'AssemblyInstaller' to the list of installers.
myInstallers->Add(myAssemblyInstaller);
// Add the installers to the 'TransactedInstaller' instance.
myTransactedInstaller->Installers->AddRange(__try_cast<Installer*[]>(myInstallers->ToArray(__typeof(Installer))));
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
.NET Framework セキュリティ:
- 直前の呼び出し元の完全信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細の参照先 : 部分信頼コードからのライブラリの使用
参照
InstallerCollection クラス | InstallerCollection メンバ | System.Configuration.Install 名前空間 | InstallerCollection.AddRange オーバーロードの一覧 | Add | Remove | Installer