Aracılığıyla paylaş


InstallerCollection.AddRange Yöntem

Tanım

Belirtilen yükleyicileri bu koleksiyona ekler.

Aşırı Yüklemeler

AddRange(Installer[])

Belirtilen yükleyici dizisini bu koleksiyona ekler.

AddRange(InstallerCollection)

Belirtilen yükleyici koleksiyonunu bu koleksiyona ekler.

AddRange(Installer[])

Belirtilen yükleyici dizisini bu koleksiyona ekler.

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())

Parametreler

value
Installer[]

Bu koleksiyona eklenecek yükleyicileri temsil eden tür Installer dizisi.

Örnekler

Aşağıdaki örnekte sınıfının yöntemi gösterilmektedir AddRangeInstallerCollection . ve MyAssembly2.exeiçin MyAssembly1.exe örnekler oluştururAssemblyInstaller. Bu örnekler öğesine TransactedInstallereklenir. Yükleme işlemi hem hem MyAssembly2.exede MyAssembly1.exe yükler.

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()))

Açıklamalar

Parent Eklenen Installer her bir özelliği, bu koleksiyonu içeren değerine ayarlanırInstaller.

Ayrıca bkz.

Şunlara uygulanır

AddRange(InstallerCollection)

Belirtilen yükleyici koleksiyonunu bu koleksiyona ekler.

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)

Parametreler

value
InstallerCollection

InstallerCollection Bu koleksiyona eklenecek yükleyicileri temsil eden bir.

Örnekler

Aşağıdaki örnek, yöntemini ve AddRange sınıfının yöntemlerini InstallerCollection gösterirInsert. ve MyAssembly2.exeiçin MyAssembly1.exe örnekler oluştururAssemblyInstaller. Bu örnekleri AssemblyInstaller adlandırılmış myTransactedInstaller1bir TransactedInstaller öğesine eklenir. içindeki myTransactedInstaller1 yükleyiciler adlı myTransactedInstaller2başka bir TransactedInstaller dosyaya kopyalanır. Yükleme işlemi hem hem MyAssembly2.exede MyAssembly1.exe yükler.

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)

Açıklamalar

Parent Eklenen Installer her bir özelliği, bu koleksiyonu içeren değerine ayarlanırInstaller.

Ayrıca bkz.

Şunlara uygulanır