Exemplo n.º 1
0
        public int OnAfterRemoveDirectories(int cProjects, int cDirectories, IVsProject[] rgpProjects, int[] rgFirstIndices, string[] rgpszMkDocuments, VSREMOVEDIRECTORYFLAGS[] rgFlags)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (rgpProjects == null || rgpszMkDocuments == null)
            {
                return(VSErr.E_POINTER);
            }

            for (int iProject = 0, iDirectory = 0; (iProject < cProjects) && (iDirectory < cDirectories); iProject++)
            {
                int iLastDirectoryThisProject = (iProject < cProjects - 1) ? rgFirstIndices[iProject + 1] : cDirectories;

                IVsSccProject2 sccProject = rgpProjects[iProject] as IVsSccProject2;
                bool           track      = SccEvents.TrackProjectChanges(sccProject);

                for (; iDirectory < iLastDirectoryThisProject; iDirectory++)
                {
                    if (sccProject == null || !track)
                    {
                        continue; // Not handled by our provider
                    }
                    string dir = rgpszMkDocuments[iDirectory];

                    if (!SvnItem.IsValidPath(dir))
                    {
                        continue;
                    }

                    dir = SvnTools.GetNormalizedFullPath(dir);

                    SccEvents.OnProjectDirectoryRemoved(sccProject, dir, rgFlags[iDirectory]);

                    if (SccProvider.IsActive && track)
                    {
                        SccEvents.AddDelayedDelete(dir);
                    }
                }
            }

            return(VSErr.S_OK);
        }
Exemplo n.º 2
0
        public int OnAfterRemoveFiles(int cProjects, int cFiles, IVsProject[] rgpProjects, int[] rgFirstIndices, string[] rgpszMkDocuments, VSREMOVEFILEFLAGS[] rgFlags)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (rgpProjects == null || rgpszMkDocuments == null)
            {
                return(VSErr.E_POINTER);
            }

            for (int iProject = 0, iFile = 0; (iProject < cProjects) && (iFile < cFiles); iProject++)
            {
                int iLastFileThisProject = (iProject < cProjects - 1) ? rgFirstIndices[iProject + 1] : cFiles;

                IVsSccProject2 sccProject = rgpProjects[iProject] as IVsSccProject2;
                bool           track      = SccEvents.TrackProjectChanges(sccProject);

                for (; iFile < iLastFileThisProject; iFile++)
                {
                    if (sccProject == null || !track)
                    {
                        continue; // Not handled by our provider
                    }
                    string file = rgpszMkDocuments[iFile];

                    if (!SvnItem.IsValidPath(file))
                    {
                        continue;
                    }

                    file = SvnTools.GetNormalizedFullPath(file);

                    SccEvents.OnProjectFileRemoved(sccProject, file);

                    if (SccProvider.IsActive && track)
                    {
                        SccEvents.AddDelayedDelete(file);
                    }
                }
            }
            return(VSErr.S_OK);
        }