We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

VersionControlServer.GetItem Method (Int32, Int32, Boolean)

Every file and folder on the server that is running Team Foundation Server has a unique ID assigned. This method allows you to get an Item object for an old version of a file or folder, based on the changeset that version was part of. If the item cannot be found, null is returned.

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

public Item GetItem(
	int itemId,
	int changesetNumber,
	bool includeDownloadInfo
)

Parameters

itemId
Type: System.Int32

A unique ID assigned for the file or folder that you want to get.

changesetNumber
Type: System.Int32

A changeset that included this version.

includeDownloadInfo
Type: System.Boolean

If you set includeDownloadInfo to true, the returned Item object will contain the information required to download a file. The initial GetItem call will be slower, so you should only use it if you want to download the file using the returned object.

Return Value

Type: Microsoft.TeamFoundation.VersionControl.Client.Item
Returns the Item if the Item was found, otherwise it is null.

Only set includeDownloadInfo to true if you want to download the files by using the returned objects. The call will be faster and require less bandwidth when this parameter is set to false. The overloadmethods set includeDownloadInfo set to false.

Show: