_dispSolutionEvents_BeforeClosingEventHandler Temsilci

Tanım

Bir çözüm kapatılmadan önce tetiklenen olayları işler.

Bu API, ürün altyapısını destekler ve doğrudan kodunuzdan kullanıma yönelik değildir.

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()
Öznitelikler

Örnekler

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

Açıklamalar

SolutionEventsNesne kapsam dışına geçebilir ve çözüm kapatılmadan önce atık olarak toplanamaz. Bu nesneye bir başvuruyu sürdürmek için, çözüm olay işleyicilerini uyguladığınız sınıfta özel bir değişken bildirin.

Şunlara uygulanır