Installer.Install(IDictionary) Metoda

Definicja

W przypadku przesłonięcia w klasie pochodnej program wykonuje instalację.

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)

Parametry

stateSaver
IDictionary

Służy IDictionary do zapisywania informacji potrzebnych do wykonania operacji zatwierdzania, wycofywania lub odinstalowywania.

Wyjątki

Parametr stateSaver to null.

Wystąpił wyjątek w BeforeInstall procedurze obsługi zdarzeń jednego z instalatorów w kolekcji.

-lub-

Wystąpił wyjątek w AfterInstall procedurze obsługi zdarzeń jednego z instalatorów w kolekcji.

Przykłady

W poniższym przykładzie pokazano metodę InstallInstaller klasy . Klasa pochodzi z klasy bazowej Installer , a Install metoda jest zastępowana.

   // 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

Uwagi dotyczące dziedziczenia

Dotyczy

Zobacz też