InstallerCollection.AddRange メソッド

定義

指定したインストーラーをコレクションに追加します。

オーバーロード

AddRange(Installer[])

指定したインストーラー配列をコレクションに追加します。

AddRange(InstallerCollection)

コレクションに、指定したインストーラー コレクションを追加します。

AddRange(Installer[])

指定したインストーラー配列をコレクションに追加します。

public:
 void AddRange(cli::array <System::Configuration::Install::Installer ^> ^ value);
public void AddRange (System.Configuration.Install.Installer[] value);
member this.AddRange : System.Configuration.Install.Installer[] -> unit
Public Sub AddRange (value As Installer())

パラメーター

value
Installer[]

コレクションに追加するインストーラーを表す Installer 型の配列。

InstallerCollectionクラスのAddRangeメソッドの例を次に示します。 と MyAssembly2.exeのインスタンスをMyAssembly1.exe作成AssemblyInstallerします。 これらのインスタンスはTransactedInstallerに追加されます。 インストール プロセスでは、 と MyAssembly2.exeの両方MyAssembly1.exeがインストールされます。

ArrayList^ myInstallers = gcnew ArrayList;
TransactedInstaller^ myTransactedInstaller = gcnew TransactedInstaller;
AssemblyInstaller^ myAssemblyInstaller;
InstallContext^ myInstallContext;

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

// Add the instance of 'AssemblyInstaller' to the list of installers.
myInstallers->Add( myAssemblyInstaller );

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

// Add the instance of 'AssemblyInstaller' to the list of installers.
myInstallers->Add( myAssemblyInstaller );

// Add the installers to the 'TransactedInstaller' instance.
myTransactedInstaller->Installers->AddRange( safe_cast<array<Installer^>^>(myInstallers->ToArray( Installer::typeid )) );
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)));
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()))

注釈

Parent追加Installerされた各 の プロパティは、このコレクションを含む にInstaller設定されます。

こちらもご覧ください

適用対象

AddRange(InstallerCollection)

コレクションに、指定したインストーラー コレクションを追加します。

public:
 void AddRange(System::Configuration::Install::InstallerCollection ^ value);
public void AddRange (System.Configuration.Install.InstallerCollection value);
member this.AddRange : System.Configuration.Install.InstallerCollection -> unit
Public Sub AddRange (value As InstallerCollection)

パラメーター

value
InstallerCollection

コレクションに追加するインストーラーを表す InstallerCollection

次の例では、 クラスの Insert メソッドと AddRange メソッドを InstallerCollection 示します。 と MyAssembly2.exeのインスタンスをMyAssembly1.exe作成AssemblyInstallerします。 これらの インスタンスはAssemblyInstaller、 という名前myTransactedInstaller1TransactedInstaller に追加されます。 内myTransactedInstaller1のインストーラーは、 という名前myTransactedInstaller2の別TransactedInstallerの にコピーされます。 インストール プロセスでは、 と MyAssembly2.exeの両方MyAssembly1.exeがインストールされます。

TransactedInstaller^ myTransactedInstaller1 = gcnew TransactedInstaller;
TransactedInstaller^ myTransactedInstaller2 = gcnew TransactedInstaller;
AssemblyInstaller^ myAssemblyInstaller = gcnew AssemblyInstaller;
InstallContext^ myInstallContext;

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

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

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

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

// Copy the installers of 'myTransactedInstaller1' to 'myTransactedInstaller2'.
myTransactedInstaller2->Installers->AddRange( myTransactedInstaller1->Installers );
TransactedInstaller myTransactedInstaller1 = new TransactedInstaller();
TransactedInstaller myTransactedInstaller2 = new TransactedInstaller();
AssemblyInstaller myAssemblyInstaller = new AssemblyInstaller();
InstallContext myInstallContext;

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

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

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

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

// Copy the installers of 'myTransactedInstaller1' to 'myTransactedInstaller2'.
myTransactedInstaller2.Installers.AddRange(myTransactedInstaller1.Installers);
Dim myTransactedInstaller1 As New TransactedInstaller()
Dim myTransactedInstaller2 As New TransactedInstaller()
Dim myAssemblyInstaller As New 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 'TransactedInstaller'.
myTransactedInstaller1.Installers.Insert(0, myAssemblyInstaller)

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

' Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller1.Installers.Insert(1, myAssemblyInstaller)

' Copy the installers of 'myTransactedInstaller1' to 'myTransactedInstaller2'.
myTransactedInstaller2.Installers.AddRange(myTransactedInstaller1.Installers)

注釈

Parent追加Installerされた各 の プロパティは、このコレクションを含む にInstaller設定されます。

こちらもご覧ください

適用対象