Bagikan melalui


Installer.Install(IDictionary) Metode

Definisi

Ketika ditimpa di kelas turunan, lakukan penginstalan.

public:
 virtual void Install(System::Collections::IDictionary ^ stateSaver);
public virtual void Install (System.Collections.IDictionary stateSaver);
abstract member Install : System.Collections.IDictionary -> unit
override this.Install : System.Collections.IDictionary -> unit
Public Overridable Sub Install (stateSaver As IDictionary)

Parameter

stateSaver
IDictionary

Digunakan IDictionary untuk menyimpan informasi yang diperlukan untuk melakukan operasi penerapan, pembatalan, atau penghapusan instalasi.

Pengecualian

Parameternya stateSaver adalah null.

Pengecualian terjadi dalam penanganan BeforeInstall aktivitas salah satu penginstal dalam koleksi.

-atau-

Pengecualian terjadi dalam penanganan AfterInstall aktivitas salah satu penginstal dalam koleksi.

Contoh

Contoh berikut menunjukkan Install metode Installer kelas . Kelas berasal dari Installer kelas dasar dan Install metode ditimpa.

   // Override the 'Install' method of the Installer class.
public:
   virtual void Install( IDictionary^ mySavedState ) override
   {
      Installer::Install( mySavedState );
      // Code maybe written for installation of an application.
      Console::WriteLine( "The Install method of 'MyInstallerSample' has been called" );
   }
// Override the 'Install' method of the Installer class.
public override void Install( IDictionary mySavedState )
{
   base.Install( mySavedState );
   // Code maybe written for installation of an application.
   Console.WriteLine( "The Install method of 'MyInstallerSample' has been called" );
}
' Override the 'Install' method of the Installer class.
Public Overrides Sub Install(mySavedState As IDictionary)
   MyBase.Install(mySavedState)
   ' Code maybe written for installation of an application.
   Console.WriteLine("The Install method of 'MyInstallerSample' has been called")
End Sub

Catatan Bagi Inheritor

Berlaku untuk

Lihat juga