public int OnAfterOpenProject([InAttribute] IVsHierarchy pHierarchy, [InAttribute] int fAdded) { Trace.WriteLine("OnAfterOpenProject"); //if (fAdded == 1) { IVsSccProject2 project = pHierarchy as IVsSccProject2; IList <string> fileList = SccProvider.GetProjectFiles(project); _sccStatusTracker.AddFileToProjectCache(fileList, project); if (fileList.Count > 0) { string[] files = new string[fileList.Count]; fileList.CopyTo(files, 0); // add only files wich are not ignored if (Configuration.Global._autoAddFiles) { _sccStatusTracker.AddWorkItem(new HGLib.TrackFilesAddedNotIgnored(files)); } else { _sccStatusTracker.AddWorkItem(new HGLib.UpdateFileStatusCommand(files)); } } } _sccProvider._LastSeenProjectDir = SccProjectData.ProjectDirectory(pHierarchy); _sccStatusTracker.UpdateProject(pHierarchy as IVsSccProject2); return(VSConstants.S_OK); }
public int OnAfterLoadProject([InAttribute] IVsHierarchy pStubHierarchy, [InAttribute] IVsHierarchy pRealHierarchy) { Trace.WriteLine("OnAfterLoadProject"); _sccProvider._LastSeenProjectDir = SccProjectData.ProjectDirectory(pRealHierarchy); _sccStatusTracker.UpdateProject(pRealHierarchy as IVsSccProject2); return(VSConstants.S_OK); }
/// <summary> /// Called by SccProviderSrvice when a scc-capable project is opened /// </summary> /// <param name="project">The loaded project</param> /// <param name="added">The project was added after opening</param> internal void UpdateProject(IVsSccProject2 project) { if (project != null) { string projectDirectory = SccProjectData.ProjectDirectory((IVsHierarchy)project); string projectName = SccProjectData.ProjectName((IVsHierarchy)project); AddWorkItem(new HGLib.UpdateRootDirectoryAdded(projectDirectory)); } }