Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to get the latest source control status for specific project item in Solution Explorer?

$
0
0

Hi guys,

I have a problem similar with below link:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/e526719b-d6a2-499b-8663-7329c3d29cd4/how-to-update-glyph-for-specific-project-item-in-solution-explorer

I try to get the latest source control status of specific item in solution explorer from the TFS/VSS by the method IVsSccManager2.GetSccGlyph.

(MSDN: This method is called by projects to discover the source control glyphs to use on files and the files' source control status; this is the only way to get status.).

IVsSccManager2 sccManager = this.ProjectMgr.GetService(typeof(SVsSccManager)) as IVsSccManager2;

if (sccManager != null)

{

      string[] rgpszFullPaths = new string[1];

      rgpszFullPaths[0] = @"C:\TEMP\TestFile.cs";

      VsStateIcon[] rgsiGlyphs = new VsStateIcon[1];

      uint[] rgdwSccStatus = new uint[1];

      sccManager.GetSccGlyph(1, rgpszFullPaths, rgsiGlyphs, rgdwSccStatus);

      VsStateIcon stateIcon = rgsiGlyphs[0];

}

I found I can’t get the latest status here in a multiple users environment like as below scenario:

Step1: user1 check out TestFile.cs and do some change, and save in local but not check in.

Step2: user2 try to get specific version of TestFile.cs, here we will found the status of TestFile.cs still is STATEICON_CHECKEDIN after call the above code. It should beVsStateIcon.STATEICON_CHECKEDOUTEXCLUSIVEOTHER orVsStateIcon.STATEICON_CHECKEDOUTSHAREDOTHER.

I know if we call refresh method in solution explorer, we can get the latest status, but it will refresh all items in solution explorer, it has performance issue.

It’s not  meets my requirements.

My question is how to get the latest status for specific/one item by SCC API?


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>