private void UnRegisterSolutionEvents()
{
ThreadHelper.ThrowIfNotOnUIThread();
// Unregister from receiving solution events
if (VSConstants.VSCOOKIE_NIL != _vsSolutionEventsCookie)
{
IVsSolution sol = (IVsSolution)_sccProvider.GetService(typeof(SVsSolution));
sol.UnadviseSolutionEvents(_vsSolutionEventsCookie);
_vsSolutionEventsCookie = VSConstants.VSCOOKIE_NIL;
}
if (VSConstants.VSCOOKIE_NIL != _vsIVsUpdateSolutionEventsCookie)
{
var sbm = _sccProvider.GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager2;
sbm.UnadviseUpdateSolutionEvents(_vsIVsUpdateSolutionEventsCookie);
}
}