Installer.OnCommitting(IDictionary) Método

Definição

Aciona o evento Committing.Raises the Committing event.

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

Parâmetros

savedState
IDictionary

Um IDictionary que contém o estado do computador antes que os instaladores na propriedade Installers sejam confirmados.An IDictionary that contains the state of the computer before the installers in the Installers property are committed.

Exemplos

O exemplo a seguir demonstra o OnCommitting método da Installer classe.The following example demonstrates the OnCommitting method of the Installer class. O OnCommitting método é substituído na classe derivada.The OnCommitting method is overridden in the derived class. O espaço é fornecido para que o usuário adicione as etapas a serem executadas antes de confirmar e após a confirmação.Space is provided for the user to add the steps to be performed before committing and after committing.

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

Comentários

Esse método é chamado antes que os Commit métodos dos instaladores nesta instância InstallerCollection sejam executados.This method is called before the Commit methods of the installers in this instance's InstallerCollection run.

A geração de um evento invoca o manipulador de eventos por meio de um delegado.Raising an event invokes the event handler through a delegate. Para obter mais informações, consulte manipulando e gerando eventos.For more information, see Handling and Raising Events.

O OnCommitting método permite que classes derivadas manipulem o evento sem anexar um delegado.The OnCommitting method allows derived classes to handle the event without attaching a delegate. Essa é a técnica preferida para manipular o evento em uma classe derivada.This is the preferred technique for handling the event in a derived class.

Notas aos Herdeiros

Ao substituir OnCommitting(IDictionary) em uma classe derivada, certifique-se de chamar o método da classe base OnCommitting(IDictionary) para que os delegados registrados recebam o evento.When overriding OnCommitting(IDictionary) in a derived class, be sure to call the base class's OnCommitting(IDictionary) method so that registered delegates receive the event.

Aplica-se a

Confira também