共用方式為


Installer.Uninstall(IDictionary) 方法

定義

當在衍生類別中被覆寫時,移除安裝。

public:
 virtual void Uninstall(System::Collections::IDictionary ^ savedState);
public virtual void Uninstall (System.Collections.IDictionary savedState);
abstract member Uninstall : System.Collections.IDictionary -> unit
override this.Uninstall : System.Collections.IDictionary -> unit
Public Overridable Sub Uninstall (savedState As IDictionary)

參數

savedState
IDictionary

IDictionary,包含安裝完成之後的電腦狀態。

例外狀況

IDictionary 的儲存狀態可能已經損毀。

解除安裝時發生例外狀況。 這個例外狀況會被忽略,解除安裝會繼續進行。 不過,解除安裝完成之後,應用程式可能沒有完全解除安裝。

範例

下列範例示範 UninstallInstaller方法。 方法 Uninstall 會在的 Installer衍生類別中覆寫。

   // Override 'Uninstall' method of Installer class.
public:
   virtual void Uninstall( IDictionary^ mySavedState ) override
   {
      if ( mySavedState == nullptr )
      {
         Console::WriteLine( "Uninstallation Error !" );
      }
      else
      {
         Installer::Uninstall( mySavedState );
         Console::WriteLine( "The Uninstall method of 'MyInstallerSample' has been called" );
      }
   }
// Override 'Uninstall' method of Installer class.
public override void Uninstall( IDictionary mySavedState )
{
   if (mySavedState == null)
   {
      Console.WriteLine("Uninstallation Error !");
   }
   else
   {
      base.Uninstall( mySavedState );
      Console.WriteLine( "The Uninstall method of 'MyInstallerSample' has been called" );
   }
}
' Override 'Uninstall' method of Installer class.
Public Overrides Sub Uninstall(mySavedState As IDictionary)
   If mySavedState Is Nothing Then
      Console.WriteLine("Uninstallation Error !")
   Else
      MyBase.Uninstall(mySavedState)
      Console.WriteLine("The Uninstall method of 'MyInstallerSample' has been called")
   End If
End Sub

給繼承者的注意事項

適用於

另請參閱