_dispSolutionEvents_BeforeClosingEventHandler – delegát

Toto rozhraní API podporuje infrastrukturu rozhraní .NET Framework a není určeno pro použití přímo v kódu.

Zpracovává události, které jsou aktivována před uzavřením řešení.

Obor názvů:  EnvDTE
Sestavení:  EnvDTE (v EnvDTE.dll)

Syntaxe

'Deklarace
<ComVisibleAttribute(False)> _
Public Delegate Sub _dispSolutionEvents_BeforeClosingEventHandler
[ComVisibleAttribute(false)]
public delegate void _dispSolutionEvents_BeforeClosingEventHandler()
[ComVisibleAttribute(false)]
public delegate void _dispSolutionEvents_BeforeClosingEventHandler()
[<ComVisibleAttribute(false)>]
type _dispSolutionEvents_BeforeClosingEventHandler = 
    delegate of unit -> unit
Jazyk JScript nepodporuje delegáty.

Poznámky

SolutionEvents Objektu můžete přejít z oboru a nesmyslné shromážděných před roztok je uzavřen.Chcete-li zachovat odkaz na tento objekt Deklarujte soukromé proměnné třídy provést obslužné rutiny událostí řešení.

Příklady

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");
    }
}

Viz také

Referenční dokumentace

EnvDTE – obor názvů