0

I'm developing a WinForms application with SourceGear's Vault Client .NET API

I want to get more information of files that are checked out. The code below loops through each file of checkouts.

Problem: the only (file) properties I can access are FileId and CheckOutUsers.

Expectation: I need to get File Name and additional info if available.

VaultClientCheckOutList chList = ServerOperations.ProcessCommandListCheckOuts();
foreach (var item in chList.Cast<VaultClientCheckOutItem>().ToList())
{
   list.Add(item.FileID.ToString());
}
Tassisto
  • 9,877
  • 28
  • 100
  • 157

1 Answers1

0

The code below is the solution The first foreach-loop is to iterate over the checked out items. To access the files of a checked out item I had iterate over CheckOutUsers peroperty (second foreach-loop).

List<string> list = new List<string>(); 
VaultClientCheckOutList chList = ServerOperations.ProcessCommandListCheckOuts();
foreach (var item in chList.Cast<VaultClientCheckOutItem>().ToList())
{
    foreach (var file in item.CheckOutUsers)
        list.Add(file.LocalPath);
}
Tassisto
  • 9,877
  • 28
  • 100
  • 157