int IVsSolutionEvents.OnAfterOpenProject(IVsHierarchy pHierarchy, int fAdded) { ThreadHelper.ThrowIfNotOnUIThread(); if (OnAfterOpenProject != null) { Project?project = SolutionItem.FromHierarchy(pHierarchy, 1) as Project; OnAfterOpenProject?.Invoke(project); } return(VSConstants.S_OK); }
int IVsSolutionEvents.OnAfterOpenProject(IVsHierarchy pHierarchy, int fAdded) { ThreadHelper.ThrowIfNotOnUIThread(); if (OnAfterOpenProject != null) { SolutionItem?item = SolutionItem.FromHierarchy(pHierarchy, VSConstants.VSITEMID_ROOT) as Project; if (item is Project project) { OnAfterOpenProject?.Invoke(project); } #if VS14 else if (item is SolutionFolder folder && folder.FullPath != null) { OnAfterOpenFolder?.Invoke(folder.FullPath); } #endif } return(VSConstants.S_OK); }