int IVsSolutionEvents.OnBeforeUnloadProject(IVsHierarchy pRealHierarchy, IVsHierarchy pStubHierarchy)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (OnBeforeCloseProject != null)
            {
                Project?project = SolutionItem.FromHierarchy(pRealHierarchy, 1) as Project;
                OnBeforeUnloadProject?.Invoke(project);
            }
            return(VSConstants.S_OK);
        }
Ejemplo n.º 2
0
        int IVsSolutionEvents.OnBeforeUnloadProject(IVsHierarchy pRealHierarchy, IVsHierarchy pStubHierarchy)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (OnBeforeUnloadProject != null)
            {
                SolutionItem?item = SolutionItem.FromHierarchy(pRealHierarchy, VSConstants.VSITEMID_ROOT);
                if (item is Project project)
                {
                    OnBeforeUnloadProject?.Invoke(project);
                }
            }
            return(VSConstants.S_OK);
        }