Installer.OnAfterInstall(IDictionary) 方法

定义

引发 AfterInstall 事件。

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)

参数

savedState
IDictionary

IDictionary 包含在 Installers 属性中包含的所有安装程序都完成它们的安装后计算机的状态。

示例

下面的示例演示 OnAfterInstall 方法。 此方法在派生类中重写。 提供了空间以添加在 方法中 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

注解

在运行此实例InstallerCollection的所有安装程序的方法之后Install调用此方法。

引发事件时,将通过委托调用事件处理程序。 有关详细信息,请参阅 处理和引发事件

方法 OnAfterInstall 允许派生类在不附加委托的情况下处理事件。 这是在派生类中处理事件的首选技术。

继承者说明

在派生类中重写 OnAfterInstall(IDictionary) 时,一定要调用基类的 OnAfterInstall(IDictionary) 方法,以便已注册的委托对事件进行接收。

适用于

另请参阅