_dispSolutionEvents_BeforeClosingEventHandler Délégué
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Gère les événements déclenchés avant la fermeture d'une solution.
Cette API prend en charge l'infrastructure du produit et n'est pas destinée à être utilisée directement à partir de votre 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)>]
[<System.Runtime.InteropServices.TypeLibType(16)>]
type _dispSolutionEvents_BeforeClosingEventHandler = delegate of unit -> unit
Public Delegate Sub _dispSolutionEvents_BeforeClosingEventHandler()
- Attributs
Exemples
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");
}
}
Remarques
L' SolutionEvents objet peut sortir de la portée et être récupéré par le garbage collector avant la fermeture de la solution. Pour conserver une référence à cet objet, déclarez une variable privée dans la classe dans laquelle vous implémentez les gestionnaires d’événements de la solution.