IDTExtensibility2.OnDisconnection 方法

每当从 Visual Studio 中卸载外接程序时发生。

命名空间:  Extensibility
程序集:  Extensibility(在 Extensibility.dll 中)

语法

声明
Sub OnDisconnection ( _
    RemoveMode As ext_DisconnectMode, _
    ByRef custom As Array _
)
void OnDisconnection(
    ext_DisconnectMode RemoveMode,
    ref Array custom
)
void OnDisconnection(
    [InAttribute] ext_DisconnectMode RemoveMode, 
    [InAttribute] Array^% custom
)
abstract OnDisconnection : 
        RemoveMode:ext_DisconnectMode * 
        custom:Array byref -> unit
function OnDisconnection(
    RemoveMode : ext_DisconnectMode, 
    custom : Array
)

参数

  • custom
    类型:Array%

    一个空数组,可用来传递在卸载外接程序后使用的特定于主机的数据。

备注

OnDisconnection(与 OnBeginShutdown 相似)每当卸载外接程序而集成开发环境 (IDE) 仍在运行时发生。(每当关闭 IDE 时发生 OnBeginShutdown,此时需要卸载正在运行的外接程序。)

示例

Public Sub OnDisconnection(ByVal disconnectMode As  _
ext_DisconnectMode, ByRef custom As Array) Implements _
IDTExtensibility2.OnDisconnection
    MsgBox("Place cleanup code here.")
End Sub
public void OnDisconnection(ext_DisconnectMode disconnectMode, ref 
Array custom)
{
    // Place cleanup code here.
    System.Windows.Forms.MessageBox.Show("Add-in is shutting down.");
}

.NET Framework 安全性

请参阅

参考

IDTExtensibility2 接口

Extensibility 命名空间

IDTExtensibility2

OnConnection

OnAddInsUpdate

OnBeginShutdown

OnStartupComplete

其他资源

如何:创建外接程序