Getting the Source Control path of a file - VS SDK

By Anoop Madhusudanan

Vote on HN
If you are developing VS Packages, here is something you might need to have a look into.

We are obtaining the source control bindings, and local bindings of the window's document, and finds the source control path from that.
public string GetSCPath(EnvDTE.Window window) 
 EnvDTE.Document doc=window.Document;

 if (window.DTE.SourceControl.IsItemUnderSCC
                SourceControlBindings bindings = 
                   (window.DTE.SourceControl as 

                string scPath=bindings.ServerBinding +
                return scPath;

     return null;

No comments:

Post a Comment

Please keep your comments clean.

© 2012. All Rights Reserved.