Example #1
0
        int IVsSolutionEvents.OnBeforeCloseProject(IVsHierarchy pHierarchy, int fRemoved)
        {
            // This function is called after a Visual Studio project is closed

            // Get the actual Project object from the IVsHierarchy object that was supplied
            var ClosedProject = Utils.HierarchyObjectToProject(pHierarchy);

            if (ClosedProject != null && OnProjectClosed != null)
            {
                LoadedProjectPaths.Remove(ClosedProject.FullName);
                OnProjectClosed(ClosedProject);
            }

            return(VSConstants.S_OK);
        }
Example #2
0
        int IVsSolutionEvents.OnAfterOpenProject(IVsHierarchy pHierarchy, int fAdded)
        {
            // This function is called after a Visual Studio project is opened (or a new project is created.)

            // Get the actual Project object from the IVsHierarchy object that was supplied
            var OpenedProject = Utils.HierarchyObjectToProject(pHierarchy);

            Utils.OnProjectListChanged();
            if (OpenedProject != null && OnProjectOpened != null)
            {
                LoadedProjectPaths.Add(OpenedProject.FullName);
                OnProjectOpened(OpenedProject);
            }

            return(VSConstants.S_OK);
        }