Installer.OnBeforeInstall(IDictionary) Metode

Definisi

Memunculkan kejadian BeforeInstall.

protected:
 virtual void OnBeforeInstall(System::Collections::IDictionary ^ savedState);
protected virtual void OnBeforeInstall (System.Collections.IDictionary savedState);
abstract member OnBeforeInstall : System.Collections.IDictionary -> unit
override this.OnBeforeInstall : System.Collections.IDictionary -> unit
Protected Overridable Sub OnBeforeInstall (savedState As IDictionary)

Parameter

savedState
IDictionary

Yang IDictionary berisi status komputer sebelum alat penginstal di Installers properti diinstal. Objek ini IDictionary harus kosong pada saat ini.

Contoh

Contoh berikut menunjukkan OnBeforeInstall metode . Metode ini ditimpa di kelas turunan. Ruang disediakan untuk menambahkan langkah-langkah yang harus dilakukan sebelum penginstalan dalam OnBeforeInstall metode .

   // Override the 'OnBeforeInstall' method.
protected:
   virtual void OnBeforeInstall( IDictionary^ savedState ) override
   {
      Installer::OnBeforeInstall( savedState );
      
      // Add steps to be done before the installation starts.
      Console::WriteLine( "OnBeforeInstall method of MyInstaller called" );
   }
// Override the 'OnBeforeInstall' method.
protected override void OnBeforeInstall(IDictionary savedState)
{
   base.OnBeforeInstall(savedState);
   // Add steps to be done before the installation starts.
   Console.WriteLine("OnBeforeInstall method of MyInstaller called");
}
' Override the 'OnBeforeInstall' method.
Protected Overrides Sub OnBeforeInstall(savedState As IDictionary)
   MyBase.OnBeforeInstall(savedState)
   ' Add steps to be done before the installation starts.
   Console.WriteLine("OnBeforeInstall method of MyInstaller called")
End Sub

Keterangan

Metode ini dipanggil sebelum Install metode alat penginstal dalam instans InstallerCollection ini dipanggil.

Menaikkan peristiwa memanggil penanganan aktivitas melalui delegasi. Untuk informasi selengkapnya, lihat Menangani dan Menaikkan Peristiwa.

Metode ini OnBeforeInstall memungkinkan kelas turunan untuk menangani peristiwa tanpa melampirkan delegasi. Ini adalah teknik yang disukai untuk menangani peristiwa di kelas turunan.

Catatan Bagi Inheritor

Saat mengambil alih di kelas turunan OnBeforeInstall(IDictionary) , pastikan untuk memanggil metode kelas OnBeforeInstall(IDictionary) dasar sehingga delegasi terdaftar menerima peristiwa tersebut.

Berlaku untuk

Lihat juga