示例#1
0
        public bool GetRawOtherSccProviderActive()
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            IVsSccManager2 manager = GetService <IVsSccManager2>(typeof(SVsSccManager));

            if (manager == null)
            {
                return(false);
            }

            // If the active manager is not installed, it is not active
            int installed = 0;

            if (!VSErr.Succeeded(manager.IsInstalled(out installed)) || (installed == 0))
            {
                return(false);
            }

            if (GetOtherSccActive())
            {
                return(true);
            }

            return(false);
        }
示例#2
0
            public int SccGlyphChanged(int cAffectedNodes, uint[] rgitemidAffectedNodes, VsStateIcon[] rgsiNewGlyphs, uint[] rgdwNewSccStatus)
            {
                IVsSccManager2 sccService = _context.GetService <IVsSccManager2>(typeof(SVsSccManager));

                string[] rgpszFullPaths = new string[1];
                rgpszFullPaths[0] = GetSolutionFileName(_context);
                VsStateIcon[] rgsiGlyphs    = new VsStateIcon[1];
                uint[]        rgdwSccStatus = new uint[1];
                sccService.GetSccGlyph(1, rgpszFullPaths, rgsiGlyphs, rgdwSccStatus);

                // Set the solution's glyph directly in the hierarchy
                IVsHierarchy solHier = (IVsHierarchy)_context.GetService(typeof(SVsSolution));

                return(solHier.SetProperty(VSItemId.Root, (int)__VSHPROPID.VSHPROPID_StateIconIndex, (int)rgsiGlyphs[0]));
            }
 private void getFileSscStatus(ProjectItems projectItems, IVsSccManager2 sscMgr)
 {
     if (projectItems == null || projectItems.Count == 0)
     {
         return;
     }
     foreach (ProjectItem item in projectItems)
     {
         if (item.Properties != null)
         {
             Property fullName = item.Properties.Item("FullPath");
             if (fullName != null)
             {
                 VsStateIcon[] icons  = new VsStateIcon[1];
                 uint[]        status = new uint[1];
                 if (VSConstants.S_OK == sscMgr.GetSccGlyph(1, new[] { fullName.Value.ToString() }, icons, status))
                 {
                     Debug.WriteLine(string.Format("status {0} - file {1}", status[0], fullName.Value));
                 }
             }
         }
         getFileSscStatus(item.ProjectItems, sscMgr);
     }
 }