GetItems Method (ItemSpec[], VersionSpec, DeletedState, ItemType)
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

VersionControlServer.GetItems Method (ItemSpec[], VersionSpec, DeletedState, ItemType)

Gets a list of all items in the repository that matches the specified paths and the version. The retrieval process is done in one pass to and from the server, therefore, it is faster to call this function once with five ItemSpec objects than to make five separate function calls. Download information is not included. Without download information the function call is faster, but if you want to download files, you should use one of the overload methods that will allow you to get download information with the returned items.

Namespace:  Microsoft.TeamFoundation.VersionControl.Client
Assembly:  Microsoft.TeamFoundation.VersionControl.Client (in Microsoft.TeamFoundation.VersionControl.Client.dll)

public ItemSet[] GetItems(
	ItemSpec[] itemSpecs,
	VersionSpec version,
	DeletedState deletedState,
	ItemType itemType


Type: Microsoft.TeamFoundation.VersionControl.Client.ItemSpec[]
Type: Microsoft.TeamFoundation.VersionControl.Client.VersionSpec

The version of the passed items. Since this one version applies to all the items, it would be unusual to use a version number ("give me version 6 of all these things"); it would be much more common to use a date, a label, or VersionSpec.Latest which gets the current version of all items.

Type: Microsoft.TeamFoundation.VersionControl.Client.DeletedState

The DeletedState.NonDeleted from which you want to get non-deleted items, The DeletedState.Deleted from which you want to get deleted items, or the DeletedState.Any from which you want to get both.

Note that the deletion ID in the ItemSpec refers to the object that you are passing in; the DeletedState refers to the objects being returned. (You could, for instance, ask for deleted files inside a non-deleted folder.)

Type: Microsoft.TeamFoundation.VersionControl.Client.ItemType

The ItemType.Folder from which you want to get folders, the ItemType.File from which you want to get files, or the ItemType.Any from which you want to get both.

Return Value

Type: Microsoft.TeamFoundation.VersionControl.Client.ItemSet[]
The returned ItemSet objects that match the passed ItemSpecs one-for-one, so that the third item in the returned array corresponds to the third item in the itemSpecs array, and continues in this pattern. Each ItemSet contains a QueryPath (which is null if the searched path was not valid), the matched pattern, and an array of Item objects for all the items that were getd.

© 2015 Microsoft