sorting history query in API

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
realtytrac
Posts: 34
Joined: Wed Jun 15, 2005 2:07 pm

sorting history query in API

Post by realtytrac » Tue Jun 28, 2005 11:12 am

I am using the API to do some querying. I would like to do two sorts on a history query, first being based on the name and ascending, the second based on the version number and descending.

How do i do that? This is what i have so far, but it doesn't seem to be working. No documentation is available on the methodology of sortying.

VaultLib.VaultHistoryQueryRequest req = new VaultLib.VaultHistoryQueryRequest();
sorts.Add((long)VaultQueryRequestSort.NameSort);
sorts.Add((long)VaultQueryRequestSort.VersionSort);
sorts.Add((long)VaultQueryRequestSort.DescSort);
req.Sorts = (long[]) sorts.ToArray(typeof(long));

thanks

Haider

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Tue Jun 28, 2005 12:22 pm

Try this:

Code: Select all

VaultLib.VaultHistoryQueryRequest req = new VaultLib.VaultHistoryQueryRequest();

uint nSort = VaultQueryRequestSort.NameSort;
sorts.Add((long)nSort);

nSort = VaultQueryRequestSort.VersionSort | VaultQueryRequestSort.DescSort;
sorts.Add((long)nSort);

req.Sorts = (long[]) sorts.ToArray(typeof(long));
Jeff Clausius
SourceGear

Post Reply