IDTExtensibility2.OnDisconnection Method

Occurs whenever an add-in is unloaded from Visual Studio.

Namespace:  Extensibility
Assembly:  Extensibility (in Extensibility.dll)

Syntax

'Declaration
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
)

Parameters

  • custom
    Type: System.Array%

    An empty array that you can use to pass host-specific data for use after the add-in unloads.

Remarks

OnDisconnection, which is similar to OnBeginShutdown, occurs whenever the add-in is unloaded, but the integrated development environment (IDE) remains running. (OnBeginShutdown occurs whenever the IDE is shut down, which necessarily unloads add-ins that are running.)

Examples

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 Security

See Also

Reference

IDTExtensibility2 Interface

Extensibility Namespace

IDTExtensibility2

OnConnection

OnAddInsUpdate

OnBeginShutdown

OnStartupComplete

Other Resources

How to: Create an Add-In