//~ Methods ..........................................................
        // ------------------------------------------------------
        public int OnAfterAddDirectoriesEx(int cProjects, int cDirectories,
			IVsProject[] rgpProjects, int[] rgFirstIndices,
			string[] rgpszMkDocuments, VSADDDIRECTORYFLAGS[] rgFlags)
        {
            CxxTestPackage.Instance.TryToRefreshTestSuitesWindow();

            return VSConstants.S_OK;
        }
コード例 #2
0
 int IVsTrackProjectDocumentsEvents2.OnAfterAddDirectoriesEx(int cProjects,
                                                             int cDirectories,
                                                             IVsProject[] rgpProjects,
                                                             int[] rgFirstIndices,
                                                             string[] rgpszMkDocuments,
                                                             VSADDDIRECTORYFLAGS[] rgFlags)
 {
     return VSConstants.S_OK;
 }
コード例 #3
0
 /// <summary>
 /// Notify the environment about a folder just added
 /// </summary>
 internal void OnFolderAdded(string folder, VSADDDIRECTORYFLAGS flag)
 {
     if ((this.projectMgr.EventTriggeringFlag & ProjectNode.EventTriggering.DoNotTriggerTrackerEvents) == 0)
     {
         ErrorHandler.ThrowOnFailure(this.GetIVsTrackProjectDocuments2().OnAfterAddDirectoriesEx(
                                         this.projectMgr.GetOuterInterface <IVsProject>(), 1, new string[1] {
             folder
         }, new VSADDDIRECTORYFLAGS[1] {
             flag
         }));
     }
 }
コード例 #4
0
        public int OnAfterAddDirectoriesEx(int cProjects, int cDirectories, IVsProject[] rgpProjects, int[] rgFirstIndices,
            string[] rgpszMkDocuments, VSADDDIRECTORYFLAGS[] rgFlags)
        {
            var args = new PostProjectAddDirectoriesEventArgs(this.events);

            //VSQUERYADDFILERESULTS.VSQUERYADDFILERESULTS_AddOK;
            //VSQUERYADDFILERESULTS.VSQUERYADDFILERESULTS_AddNotOK;

            this.events.TriggerPostProjectAddDirectories(args);

            return VSConstants.S_OK;
        }
コード例 #5
0
        public void NotifyAddDirectory(IVsProject project, string[] directories)
        {
            VSADDDIRECTORYFLAGS[] addFlags = new VSADDDIRECTORYFLAGS[directories.Length];

            for (int i = 0; i < directories.Length; i++)
            {
                addFlags[i] = VSADDDIRECTORYFLAGS.VSADDDIRECTORYFLAGS_NoFlags;
            }

            _eventSink.OnAfterAddDirectoriesEx(
                1,
                directories.Length,
                new[] { project },
                new[] { 0 },
                directories,
                addFlags);
        }
コード例 #6
0
        public void NotifyAddDirectory(IVsProject project, string[] directories)
        {
            var addFlags = new VSADDDIRECTORYFLAGS[directories.Length];

            for (int i = 0; i < directories.Length; i++)
            {
                addFlags[i] = VSADDDIRECTORYFLAGS.VSADDDIRECTORYFLAGS_NoFlags;
            }

            _eventSink.OnAfterAddDirectoriesEx(
                1,
                directories.Length,
                new[] { project },
                new[] { 0 },
                directories,
                addFlags);
        }
コード例 #7
0
 public virtual int OnAfterAddDirectoriesEx(int cProjects, int cDirectories, IVsProject[] rgpProjects, int[] rgFirstIndices, string[] rgpszMkDocuments, VSADDDIRECTORYFLAGS[] rgFlags)
 {
     return VSConstants.E_NOTIMPL;
 }
コード例 #8
0
ファイル: Builder.cs プロジェクト: bholl/zeroc-ice
 public int OnAfterAddDirectoriesEx(int cProjects, int cDirectories, IVsProject[] rgpProjects,
                                    int[] rgFirstIndices, string[] rgpszMkDocuments, 
                                    VSADDDIRECTORYFLAGS[] rgFlags)
 {
     return 0;
 }
コード例 #9
0
 public int OnAfterAddDirectoriesEx(IVsProject pProject, int cDirectories, string[] rgpszMkDocuments, VSADDDIRECTORYFLAGS[] rgFlags) {
     return VSConstants.S_OK;
 }
コード例 #10
0
ファイル: Project.cs プロジェクト: Graham-Pedersen/IronPlot
        /// We subscribes to IVsTrackProjectDocumentsEvents and trigger the
        /// corresponding event once per file per event.
        /// We filters the events to only reports those related to our project.
        /// This is NOT required for flavoring, but simplify the work the
        /// derived classes have to do when subscribing to these events

        int IVsTrackProjectDocumentsEvents2.OnAfterAddDirectoriesEx(int cProjects, int cDirectories, IVsProject[] rgpProjects, int[] rgFirstIndices, string[] rgpszMkDocuments, VSADDDIRECTORYFLAGS[] rgFlags)
        {
            GenerateEvents(rgpProjects, rgFirstIndices, rgpszMkDocuments, DirectoryAdded, new ProjectDocumentsChangeEventArgs());
            return NativeMethods.S_OK;
        }
コード例 #11
0
        /// <summary>
        /// Called when a directory is added to a project
        /// </summary>
        /// <param name="project">The project.</param>
        /// <param name="directoryname">The directoryname.</param>
        /// <param name="flags">The flags.</param>
        internal void OnProjectDirectoryAdded(IVsSccProject2 project, string directoryname, VSADDDIRECTORYFLAGS flags)
        {
            SccProjectData data;
            if (!_projectMap.TryGetValue(project, out data))
                return; // Not managed by us

            // Add a directory like a folder but with an ending '\'
            data.AddPath(GitTools.GetNormalizedFullPath(directoryname).TrimEnd('\\') + '\\');

            if (!IsActive)
                return;

            if (!data.IsWebSite)
            {
                // Do nothing
            }
            else
            {
                // Websites don't contain a real file mapping; reload to load new files
                // and directories recursively
                data.Reload();
            }
        }
コード例 #12
0
 public int OnAfterAddDirectoriesEx(IVsProject pProject, int cDirectories, string[] rgpszMkDocuments, VSADDDIRECTORYFLAGS[] rgFlags)
 {
     throw new NotImplementedException();
 }
コード例 #13
0
ファイル: ProjectTracker.Add.cs プロジェクト: necora/ank_git
        /// <summary>
        /// 
        /// </summary>
        /// <param name="cProjects"></param>
        /// <param name="cDirectories"></param>
        /// <param name="rgpProjects"></param>
        /// <param name="rgFirstIndices"></param>
        /// <param name="rgpszMkDocuments"></param>
        /// <param name="rgFlags"></param>
        /// <returns></returns>
        /// <remarks>Deny a query only if allowing the operation would compromise your stable state</remarks>
        public int OnAfterAddDirectoriesEx(int cProjects, int cDirectories, IVsProject[] rgpProjects, int[] rgFirstIndices, string[] rgpszMkDocuments, VSADDDIRECTORYFLAGS[] rgFlags)
        {
            if (rgpProjects == null || rgpszMkDocuments == null)
                return VSConstants.E_POINTER;

            for (int i = 0; i < cDirectories; i++)
            {
                string dir = rgpszMkDocuments[i];

                if (string.IsNullOrEmpty(dir) || !SvnItem.IsValidPath(dir))
                    continue;

                dir = SvnTools.GetNormalizedFullPath(dir);

                StatusCache.MarkDirty(dir);

                SvnItem item = StatusCache[dir];

                if (!item.Exists || !item.IsDirectory || !SvnTools.IsManagedPath(dir))
                    continue;

                if ((DateTime.UtcNow - GetCreated(item)) > new TimeSpan(0, 1, 0))
                    continue; // Directory is older than one minute.. Not just copied

                using (SvnSccContext svn = new SvnSccContext(Context))
                {
                    // Ok; we have a 'new' directory here.. Lets check if VS broke the subversion working copy
                    SvnWorkingCopyEntryEventArgs entry = svn.SafeGetEntry(dir);

                    if (entry != null && entry.NodeKind == SvnNodeKind.Directory) // Entry exists, valid dir
                        continue;

                    // VS Added a versioned dir below our project -> Unversion the directory to allow adding files

                    // Don't unversion the directory if the parent is not versioned
                    string parentDir = SvnTools.GetNormalizedDirectoryName(dir);
                    if (parentDir == null || !SvnTools.IsManagedPath(parentDir))
                        continue;

                    svn.UnversionRecursive(dir);
                }
            }

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

                IVsSccProject2 sccProject = rgpProjects[iProject] as IVsSccProject2;

                bool track = SccProvider.TrackProjectChanges(sccProject);

                for (; iDir < iLastDirectoryThisProject; iDir++)
                {
                    if (!track)
                        continue;

                    string dir = rgpszMkDocuments[iDir];

                    if (string.IsNullOrEmpty(dir) || !SvnItem.IsValidPath(dir))
                        continue;

                    dir = SvnTools.GetNormalizedFullPath(dir);

                    if (sccProject != null)
                        SccProvider.OnProjectDirectoryAdded(sccProject, dir, rgFlags[iDir]);
                }
            }

            return VSConstants.S_OK;
        }
コード例 #14
0
 public int OnAfterAddDirectoriesEx(int cProjects, int cDirectories, IVsProject[] rgpProjects, int[] rgFirstIndices, string[] rgpszMkDocuments, VSADDDIRECTORYFLAGS[] rgFlags) {
     foreach (var dir in rgpszMkDocuments) {
         DocumentEvents.Add("OnAfterAddDirectoriesEx " + dir);
         CodeDocumentEvents.Add("OnAfterAddDirectoriesEx(" + GetRelativePath(rgpProjects[0], dir) + ")");
     }
     return VSConstants.S_OK;
 }
コード例 #15
0
 /// <summary>
 /// Notify the environment about a folder just added
 /// </summary>
 internal void OnFolderAdded(string folder, VSADDDIRECTORYFLAGS flag) {
     if ((this.projectMgr.EventTriggeringFlag & ProjectNode.EventTriggering.DoNotTriggerTrackerEvents) == 0) {
         ErrorHandler.ThrowOnFailure(this.GetIVsTrackProjectDocuments2().OnAfterAddDirectoriesEx(
             projectMgr.GetOuterInterface<IVsProject>(), 1, new string[1] { folder }, new VSADDDIRECTORYFLAGS[1] { flag }));
     }
 }
コード例 #16
0
 /// We subscribes to IVsTrackProjectDocumentsEvents and trigger the
 /// corresponding event once per file per event.
 /// We filters the events to only reports those related to our project.
 /// This is NOT required for flavoring, but simplify the work the
 /// derived classes have to do when subscribing to these events
 int IVsTrackProjectDocumentsEvents2.OnAfterAddDirectoriesEx(int cProjects, int cDirectories, IVsProject[] rgpProjects, int[] rgFirstIndices, string[] rgpszMkDocuments, VSADDDIRECTORYFLAGS[] rgFlags)
 {
     _flavoredProjectBase.GenerateEvents(rgpProjects, rgFirstIndices, rgpszMkDocuments, _flavoredProjectBase.DirectoryAdded, new ProjectDocumentsChangeEventArgs());
     return VSConstants.S_OK;
 }