If you want to use our object model to show differences between two files, you'll want to look at the methods off of the Difference class in the Microsoft.TeamFoundation.VersionControl.Client namespace/assembly, specifically ones like DiffFiles, VisualDiffFiles, VisualDiffItems, etc. Here's a simple example showing first a unified diff to stdout and then a visual diff that invokes in the appropriate registered third-party tool.
A sample run, showing a diff of 2 versions of the same file (2 different files would have been fine, too)
>difftwoversions jmanning-test $/60220-testing/test/foo.cs C11 $/60220-testing/test/foo.cs C12Difference.DiffFiles - output to consolefoo.cs===================================================================--- $/60220-testing/test/foo.cs;C11 (server) 3/7/2006 11:34 AM+++ $/60220-testing/test/foo.cs;C12 (server) 3/7/2006 11:35 AM@@ -1,6 +1,7 @@ int foo(int bar) {+ int j = 5; int i = 1;
- return bar + i;+ return bar + i + j; }Press Enter to continue
Difference.VisualDiffItems - invoke registered third-party tool[Note: the diff opened in in a separate window here]Press Enter to continue