Installer.OnAfterInstall(IDictionary) Metoda

Definicja

AfterInstall Zgłasza zdarzenie.

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

Parametry

savedState
IDictionary

Element IDictionary zawierający stan komputera po zakończeniu instalacji wszystkich instalatorów zawartych we Installers właściwości .

Przykłady

W poniższym przykładzie pokazano metodę OnAfterInstall . Ta metoda jest zastępowana w klasie pochodnej. Miejsce jest udostępniane w celu dodania kroków, które należy wykonać po instalacji w metodzie OnAfterInstall .

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

Uwagi

Ta metoda jest wywoływana po Install metodach wszystkich instalatorów w uruchomieniu InstallerCollection tego wystąpienia.

Podnoszenie zdarzenia wywołuje program obsługi zdarzeń przez delegata. Aby uzyskać więcej informacji, zobacz Obsługa i podnoszenie zdarzeń.

Metoda OnAfterInstall umożliwia klasom pochodnym obsługę zdarzenia bez dołączania delegata. Jest to preferowana technika obsługi zdarzenia w klasie pochodnej.

Uwagi dotyczące dziedziczenia

Podczas zastępowania OnAfterInstall(IDictionary) w klasie pochodnej należy wywołać metodę klasy OnAfterInstall(IDictionary) bazowej, aby zarejestrowani delegaci odbierali zdarzenie.

Dotyczy

Zobacz też