Code: Select all
public string GetLabelComment(string item, string label)
{
string objectPath = fixPath(item);
string token;
long n1, n2;
try
{
ServerOperations.client.ClientInstance.BeginLabelQuery(
objectPath,
0,
false,
false,
false,
false,
10,
out n1,
out n2,
out token);
}
catch
{
throw new UsageException(objectPath + ": no such object");
}
VaultLabelItemX[] lis;
ServerOperations.client.ClientInstance.GetLabelQueryItems_Main(token, 0, 1, out lis);
foreach (VaultLabelItemX li in lis)
{
if (li.Label == label)
{
return li.Comment;
}
}
throw new UsageException(label + ": label not found for '" + objectPath + "'");
}
}
Regards, Christoph