It is possible to have a sample on how to use the GetByLabel_GetData API function.
With the source vault version 3.1.8 I get an exception saying "Value cannot be null. Parameter name : path".
Here is the code I call :
public bool GetFolderByLabel(string remoteFolderPath, string localFolderPath, string label, bool recursive)
{
...
long labelID = 0;
long rootID = 0;
long labelSubItemId = 0;
string[] discoveredPaths;
VaultClientTreeObject labelStructure = null;
VaultClientTreeObject reposTreeObj = m_client.TreeCache.Repository.Root.FindTreeObjectRecursive(remoteFolderPath);
if (reposTreeObj == null)
{
//MessageBox.Show("Folder " + remoteFolderPath + " does not exist.");
return false;
}
labelSubItemId = reposTreeObj.ID;
if (!m_client.GetByLabel_GetStructure(remoteFolderPath, label, ref labelID, String.Empty, out discoveredPaths, out labelStructure, out rootID))
{
//MessageBox.Show("Cannot find label " + label + ".");
return false;
}
string labelSubItem = discoveredPaths[0];
VaultGetResponse[] responses = m_client.GetByLabel_GetData((VaultClientFolder) labelStructure, recursive, MakeWritableType.MakeAllFilesReadOnly, SetFileTimeType.Current, MergeType.OverwriteWorkingCopy, null, labelID, remoteFolderPath, labelSubItem);
...
}
GetByLabel_GetData API sample
Moderator: SourceGear
GetByLabel_GetData API sample
Last edited by michaelF on Thu May 11, 2006 9:33 am, edited 1 time in total.
The command line client source code has an example of these calls in the ProcessCommandGetLabel() command in VaultCmdLineClient.cs. The CLC source is included with the API installer.
So, I would suggest looking there first for usuage, and you might even want to run the CLC in the debugger to see exactly what is passed into it.
So, I would suggest looking there first for usuage, and you might even want to run the CLC in the debugger to see exactly what is passed into it.