I've been busy this week with quite an interesting little
project regarding VSTO and SourceSafe and had the opportunity (misfortune?), working
with the SourceSafe API (ssapi.ddl).
The API is pretty straightforward not much to it, I've included some code below,
which demonstrates how to do a simple get latest.
The same approach can be used (minus the get method) to build yourself a little
treeview, passing the needed node along with the recursion, generating a nested
structure.
using SourceSafeTypeLib; using System.IO; class Program { static VSSDatabaseClass database = new VSSDatabaseClass(); private static void getLatest(string Spec, string Local) { VSSItem Item = database.get_VSSItem(Spec, false); Item.Get(ref Local, 0); foreach (VSSItem ChildItem in Item.get_Items(false)) { if (ChildItem.Type == 0) { getLatest(ChildItem.Spec, Path.Combine(Local, ChildItem.Name)); } } } static void Main(string[] args) { database.Open(@"\\sourcesafe\sources\srcsafe.ini", "username", "password"); getLatest("$/SomeProject", @"c:\SomeProject\"); } }