|
Este artículo proviene de un motor de traducción automática. Mueva el puntero sobre las frases del artículo para ver el texto original. Más información.
|
Traducción
Original
|
Installer::BeforeRollback (Evento)
.NET Framework 4.5
Espacio de nombres: System.Configuration.Install
Ensamblado: System.Configuration.Install (en System.Configuration.Install.dll)
#using <System.dll> #using <System.Configuration.Install.dll> using namespace System; using namespace System::Collections; using namespace System::ComponentModel; using namespace System::Configuration::Install; // Set 'RunInstaller' attribute to true. [RunInstaller(true)] ref class MyInstallerClass: public Installer { public: MyInstallerClass() { // Attach the 'BeforeRollback' event. this->BeforeRollback += gcnew InstallEventHandler( this, &MyInstallerClass::MyInstaller_BeforeRollBack ); // Attach the 'AfterRollback' event. this->AfterRollback += gcnew InstallEventHandler( this, &MyInstallerClass::MyInstaller_AfterRollback ); } private: // Event handler for 'BeforeRollback' event. void MyInstaller_BeforeRollBack( Object^ sender, InstallEventArgs^ e ) { Console::WriteLine( "" ); Console::WriteLine( "BeforeRollback Event occured." ); Console::WriteLine( "" ); } // Event handler for 'AfterRollback' event. void MyInstaller_AfterRollback( Object^ sender, InstallEventArgs^ e ) { Console::WriteLine( "" ); Console::WriteLine( "AfterRollback Event occured." ); Console::WriteLine( "" ); } public: // Override the 'Install' method. virtual void Install( IDictionary^ savedState ) override { Installer::Install( savedState ); // Explicitly throw an exception so that roll back is called. throw gcnew ArgumentException( "Arg Exception" ); } // Override the 'Commit' method. virtual void Commit( IDictionary^ savedState ) override { Installer::Commit( savedState ); } // Override the 'Rollback' method. virtual void Rollback( IDictionary^ savedState ) override { Installer::Rollback( savedState ); } }; int main() { Console::WriteLine( "Usage : installutil.exe Installer_BeforeRollback.exe " ); }
- Plena confianza para el llamador inmediato. Un código de confianza parcial no puede utilizar este miembro. Para obtener más información, vea Utilizar bibliotecas de código que no es de plena confianza.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (no se admite el rol Server Core), Windows Server 2008 R2 (se admite el rol Server Core con SP1 o versiones posteriores; no se admite Itanium)
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.