AddInController.Shutdown 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會停用一個外掛。
public:
void Shutdown();
public void Shutdown();
member this.Shutdown : unit -> unit
Public Sub Shutdown ()
範例
以下範例取得 AddInController 一個名為 host manager view 的物件,然後關閉該外掛。
AddInController ctrl = AddInController.GetAddInController(manager);
ctrl.Shutdown();
Dim ctrl As AddInController = AddInController.GetAddInController(manager)
ctrl.Shutdown()
備註
此方法會破壞外掛與主機之間的通訊管道。 若外掛在自動產生的應用域中使用 Activate<T>(AddInSecurityLevel) or Activate<T>(PermissionSet) 方法啟動,該 Shutdown 方法也會卸載該應用域。
如果外掛被載入到自己的應用程式域,該 Shutdown 方法也會卸載該應用程式域。
若外掛已載入現有的應用域,主機與管線區段將不再有該外掛的參考。 在這種情況下,該附加元件將有資格被垃圾回收回收。
你也可以用這個類別關閉在外部程序中被啟動的外掛。