Beispiel #1
0
 private static bool GetNatvisFiles(bool solutionLevel, IVsProject4 proj, uint celt, uint[] rgitemids, out uint cActual)
 {
     if (solutionLevel)
     {
         return(Constants.S_OK == proj.GetFilesEndingWith(".natvis", celt, rgitemids, out cActual));
     }
     else
     {
         return(Constants.S_OK == proj.GetFilesWithItemType("natvis", celt, rgitemids, out cActual));
     }
 }
Beispiel #2
0
        private void FindInProjectFast(IVsProject4 vsp4, IVsHierarchy projectHierarchy)
        {
            uint celt = 0;

            uint[] rgItemIds = null;
            uint   pcActual  = 0;

            //
            // call this method twice, first time is to get the count, second time is to get the data.
            //
            VSErrorHandler.ThrowOnFailure(vsp4.GetFilesEndingWith(_input, celt, rgItemIds, out pcActual));
            if (pcActual > 0)
            {
                // now we know the actual size of the array to allocate, so invoke again
                celt      = pcActual;
                rgItemIds = new uint[celt];
                VSErrorHandler.ThrowOnFailure(vsp4.GetFilesEndingWith(_input, celt, rgItemIds, out pcActual));
                Debug.Assert(celt == pcActual, "unexpected number of entries returned from GetFilesEndingWith()");

                for (var i = 0; i < celt; i++)
                {
                    object pvar;
                    // NOTE:  in cpp, this property is not the full path.  It is the full path in c# & vb projects.
                    var hr   = projectHierarchy.GetProperty(rgItemIds[i], (int)__VSHPROPID.VSHPROPID_SaveName, out pvar);
                    var path = pvar as string;
                    if (VSErrorHandler.Succeeded(hr) &&
                        path != null)
                    {
                        // Dev10 Bug 653879: Retrieving project item absolute URL is expensive so retrieve when we actually need it.
                        VSFileInfo fileInfo;
                        fileInfo.ItemId    = rgItemIds[i];
                        fileInfo.Path      = path;
                        fileInfo.Hierarchy = projectHierarchy;
                        _paths.Add(fileInfo);
                    }
                }
            }
        }
Beispiel #3
0
        private bool GetNatvisFiles(bool solutionLevel, IVsProject4 proj, uint celt,
                                    uint[] rgitemids, out uint cActual)
        {
            taskContext.ThrowIfNotOnMainThread();

            if (solutionLevel)
            {
                return(VSConstants.S_OK == proj.GetFilesEndingWith(".natvis", celt, rgitemids,
                                                                   out cActual));
            }
            else
            {
                return(VSConstants.S_OK == proj.GetFilesWithItemType("natvis", celt, rgitemids,
                                                                     out cActual));
            }
        }
        private void FindInProjectFast(IVsProject4 vsp4, IVsHierarchy projectHierarchy)
        {
            uint celt = 0;
            uint[] rgItemIds = null;
            uint pcActual = 0;

            //
            // call this method twice, first time is to get the count, second time is to get the data.
            //
            VSErrorHandler.ThrowOnFailure(vsp4.GetFilesEndingWith(_input, celt, rgItemIds, out pcActual));
            if (pcActual > 0)
            {
                // now we know the actual size of the array to allocate, so invoke again
                celt = pcActual;
                rgItemIds = new uint[celt];
                VSErrorHandler.ThrowOnFailure(vsp4.GetFilesEndingWith(_input, celt, rgItemIds, out pcActual));
                Debug.Assert(celt == pcActual, "unexpected number of entries returned from GetFilesEndingWith()");

                for (var i = 0; i < celt; i++)
                {
                    object pvar;
                    // NOTE:  in cpp, this property is not the full path.  It is the full path in c# & vb projects.
                    var hr = projectHierarchy.GetProperty(rgItemIds[i], (int)__VSHPROPID.VSHPROPID_SaveName, out pvar);
                    var path = pvar as string;
                    if (VSErrorHandler.Succeeded(hr)
                        && path != null)
                    {
                        // Dev10 Bug 653879: Retrieving project item absolute URL is expensive so retrieve when we actually need it.
                        VSFileInfo fileInfo;
                        fileInfo.ItemId = rgItemIds[i];
                        fileInfo.Path = path;
                        fileInfo.Hierarchy = projectHierarchy;
                        _paths.Add(fileInfo);
                    }
                }
            }
        }
Beispiel #5
0
 private static bool GetNatvisFiles(bool solutionLevel, IVsProject4 proj, uint celt, uint[] rgitemids, out uint cActual)
 {
     if (solutionLevel)
     {
         return VSConstants.S_OK == proj.GetFilesEndingWith(".natvis", celt, rgitemids, out cActual);
     }
     else
     {
         return VSConstants.S_OK == proj.GetFilesWithItemType("natvis", celt, rgitemids, out cActual);
     }
 }