Code: Select all
public void getVersion(string path, long version) {
VaultClientFile file = null;
file = client.TreeCache.Repository.Root.FindFileRecursive(path);
if (file != null) {
file.Version = version;
VaultClientFile[] files = new VaultClientFile[1]; // Because GetByDisplayVersion only takes an array.
files[0] = file;
client.GetByDisplayVersion(files, MakeWritableType.MakeAllFilesReadOnly, SetFileTimeType.CheckIn, MergeType.OverwriteWorkingCopy, null);
} else
throw new Exception(string.Format("getVersion(): {0} does not exist", path));
}