0
在包我試圖建立我註冊了「BeforeClosing」事件以下列方式:取消在VS擴展解決方案,關閉事件
DTE dte = Package.GetGlobalService(typeof(DTE)) as DTE;
dte.Events.SolutionEvents.BeforeClosing += SolutionEvents_BeforeClosing;
和事件處理程序是這樣的:
private void SolutionEvents_BeforeClosing()
{
//Check some stuff
//Cancel the close operation
}
是否可以從事件處理程序(如e.Cancel = true;
)中取消關閉解決方案?