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.
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 (window.Document.FullName)) { SourceControlBindings bindings = (window.DTE.SourceControl as EnvDTE80.SourceControl2).GetBindings (window.Project.FullName); string scPath=bindings.ServerBinding + doc.FullName.ToLower().Replace (bindings.LocalBinding.ToLower(),"").Replace ("\\","/"); return scPath; } return null; }
Comments
Post a Comment
Please keep your comments clean.