locked
Visual Studio 2012 Diff Window RRS feed

Answers

  • Thursday, August 23, 2012 9:20 PM
  • Tf diff is completely seperate, if it has any kind of mode that uses VS it almost certainly retrieves the files into local temp files and passes those to VS, otherwise VS would have to have hard coded logic around TFS, but VS supports any source control provider that implements the proper interfaces and doesn't generally special case logic to rely on any specific provider.

    Edit:  Also the flags for the last argument come from here. They are typed as a uint for future proofing (i.e. adding more options that exist in a different enum would normally require a new interface method if the param were strongly typed as the associated enum. By making it a uint we can add a new enum in the future with new values (distinct from the original enum) and users can mix/match the values from any enum that they pass in). I filed bug to get the documentation updated.

    Ryan


    Friday, August 24, 2012 4:30 AM

All replies

  • Thursday, August 23, 2012 9:20 PM
  • Thank you. This is exactly what I was looking for!
    Not sure this is correct, but it seems to work.

             Microsoft.VisualStudio.Shell.ServiceProvider sp = new
                    Microsoft.VisualStudio.Shell.ServiceProvider(
                     (Microsoft.VisualStudio.OLE.Interop.IServiceProvider)_applicationObject.DTE);
                IVsDifferenceService diff = (IVsDifferenceService)sp.GetService(typeof(SVsDifferenceService));
                diff.OpenComparisonWindow2(@"C:\Temp\a.txt", @"C:\Temp\b.txt", "a", "f", "y", "r", "r", "ee", 0);
    It worls fine with files, like a.txt, b.txt, but it doesn't work if I provide a path to TFS file like

    @"$/My Project Group/ProjectA/MyCode.cs.
    Yet from the command string tf dif that path would work.

    - Is my code correct?
    - How can I provide a path to TFS?
    - What is the last uint parameter in OpenComparisionWindow2 does?

    Thanks for your help, and sorry for so many questions.






    Friday, August 24, 2012 1:11 AM
  • Tf diff is completely seperate, if it has any kind of mode that uses VS it almost certainly retrieves the files into local temp files and passes those to VS, otherwise VS would have to have hard coded logic around TFS, but VS supports any source control provider that implements the proper interfaces and doesn't generally special case logic to rely on any specific provider.

    Edit:  Also the flags for the last argument come from here. They are typed as a uint for future proofing (i.e. adding more options that exist in a different enum would normally require a new interface method if the param were strongly typed as the associated enum. By making it a uint we can add a new enum in the future with new values (distinct from the original enum) and users can mix/match the values from any enum that they pass in). I filed bug to get the documentation updated.

    Ryan


    Friday, August 24, 2012 4:30 AM