Installer.OnBeforeInstall(IDictionary) Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
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
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk