Partager via


_dispSolutionEvents_BeforeClosingEventHandler Delegate

Definition

Handles events that are fired before a solution is closed.

This API supports the product infrastructure and is not intended to be used directly from your code.

public delegate void _dispSolutionEvents_BeforeClosingEventHandler();
public delegate void _dispSolutionEvents_BeforeClosingEventHandler();
[System.Runtime.InteropServices.ComVisible(false)]
[System.Runtime.InteropServices.TypeLibType(16)]
public delegate void _dispSolutionEvents_BeforeClosingEventHandler();
[System.Runtime.InteropServices.ComVisible(false)]
public delegate void _dispSolutionEvents_BeforeClosingEventHandler();
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Runtime.InteropServices.TypeLibType(16)>]
type _dispSolutionEvents_BeforeClosingEventHandler = delegate of unit -> unit
[<System.Runtime.InteropServices.ComVisible(false)>]
type _dispSolutionEvents_BeforeClosingEventHandler = delegate of unit -> unit
Public Delegate Sub _dispSolutionEvents_BeforeClosingEventHandler()
Attributes

Examples

public class Connect : IDTExtensibility2  
{  
    private SolutionEvents _solnEvents;  

    public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)  
    {  
        _applicationObject = (DTE2)application;  
        _addInInstance = (AddIn)addInInst;  

        _solnEvents = _applicationObject.Events.SolutionEvents;  

        _solutionBeforeClosingEventHandler = new _dispSolutionEvents_BeforeClosingEventHandler(this.SolutionBeforeClosing);  
        _solnEvents.BeforeClosing += _solutionBeforeClosingEventHandler;  
    }  

    private _dispSolutionEvents_BeforeClosingEventHandler _solutionBeforeClosingEventHandler  

    private void SolutionBeforeClosing()  
    {  
        System.Windows.Forms.MessageBox.Show("SolutionBeforeClosing");  
    }  
}  

Remarks

The SolutionEvents object can go out of scope and be garbage collected before the solution is closed. To retain a reference to this object, declare a private variable in the class in which you implement the solution event handlers.

Applies to