I wrote a little app to show all labelled versions of a repository to the user.
The user shall have the option to choose a label and get all files to a working folder.
I do not want to iterate over each folder/file so I normally use the following approach to get a list of files:
Code: Select all
VaultClientFileColl theFiles = new VaultClientFileColl();
vcfolder = _SGVClient.TreeCache.Repository.Root.FindFolderRecursive(reposItem);
if (vcfolder != null)
{
ParentPath = vcfolder.FullPath;
theFiles.AddRange(vcfolder.Files);
if (Recursive)
{
foreach (VaultClientFolder subfolder1 in vcfolder.Folders)
subfolder1.GetFilesRecursive(ref theFiles, _SGVClient.TreeCache.Cloaks);
}
}
else
{
vcfile = _SGVClient.TreeCache.Repository.Root.FindFileRecursive(reposItem);
if (vcfile != null)
{
ParentPath = vcfile.FullPath;
theFiles.Add(vcfile);
}
else
{
throw new Exception(string.Format("{0} does not exist.", reposItem));
}
}
VaultClientFile[] files = (VaultClientFile[])theFiles.ToArray(typeof(VaultClientFile));
_SGVClient.GetToNonWorkingFolder(files, false, true, MakeWritableType.MakeAllFilesReadOnly, SetFileTimeType.CheckIn, ParentPath, TargetDir, null);
I am missing anything about folders and files in the code after the GetByLabel_GetStructure function.
Could you please shed some light on the Label_Getstructure usage?
Thanks,
Andreas Kroll