private int FindVersionWithLabel( ClientInstance client, VaultClientFile file, string label ) { string token; int inheritedRowCount; int recursiveRowCount; client.BeginLabelQuery( file.FullPath, file.ID, false, true, true, true, VaultClientHelper.MaxQuerySize, out inheritedRowCount, out recursiveRowCount, out token ); if( inheritedRowCount < 1 ) { client.EndLabelQuery( token ); return -1; } VaultLabelItemX[] items; client.GetLabelQueryItems_Main( token, 0, inheritedRowCount, out items ); client.EndLabelQuery( token ); foreach( VaultLabelItemX x in items ) { if( x.Label == label ) { return (int) x.Version; } } return -1; }
private int FindVersionWithLabel(ClientInstance client, VaultClientFile file, string label) { string token; int inheritedRowCount; int recursiveRowCount; client.BeginLabelQuery(file.FullPath, file.ID, false, true, true, true, VaultClientHelper.MaxQuerySize, out inheritedRowCount, out recursiveRowCount, out token); if (inheritedRowCount < 1) { client.EndLabelQuery(token); return(-1); } VaultLabelItemX[] items; client.GetLabelQueryItems_Main(token, 0, inheritedRowCount, out items); client.EndLabelQuery(token); foreach (VaultLabelItemX x in items) { if (x.Label == label) { return((int)x.Version); } } return(-1); }