VersionControlServer.GetItems Method (ItemSpec, VersionSpec, DeletedState, ItemType, Boolean)

Gets a list of all Items in the database that matches the given item specifiers.

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

Syntax

'Declaration
Public Function GetItems ( _
    itemSpec As ItemSpec, _
    version As VersionSpec, _
    deletedState As DeletedState, _
    itemType As ItemType, _
    includeDownloadInfo As Boolean _
) As ItemSet
'Usage
Dim instance As VersionControlServer 
Dim itemSpec As ItemSpec 
Dim version As VersionSpec 
Dim deletedState As DeletedState 
Dim itemType As ItemType 
Dim includeDownloadInfo As Boolean 
Dim returnValue As ItemSet 

returnValue = instance.GetItems(itemSpec, _
    version, deletedState, itemType, _
    includeDownloadInfo)
public ItemSet GetItems(
    ItemSpec itemSpec,
    VersionSpec version,
    DeletedState deletedState,
    ItemType itemType,
    bool includeDownloadInfo
)
public:
ItemSet^ GetItems(
    ItemSpec^ itemSpec, 
    VersionSpec^ version, 
    DeletedState deletedState, 
    ItemType itemType, 
    bool includeDownloadInfo
)
public function GetItems(
    itemSpec : ItemSpec, 
    version : VersionSpec, 
    deletedState : DeletedState, 
    itemType : ItemType, 
    includeDownloadInfo : boolean
) : ItemSet

Parameters

  • itemSpec
    Type: Microsoft.TeamFoundation.VersionControl.Client.ItemSpec

    The files or folders that you want to get. Each ItemSpec contains:

    A string that specifies the item name. This may be a Team Foundation Server path ($/CmdLine/parse.cs) or a local path (C:\Code\CmdLine\parse.cs), in the latter case, the local path is mapped to a server path via a workspace. Wildcards are also supported.

    A recursion type that determines what files and folders that you want to get.

    RecursionType.None gets the passed items only; if you passed in $/CmdLine then you will get only the folder $/CmdLine. RecursionType.OneLevel examines the passed items and, in the case of folders, their children; if you passed in $/CmdLine you will get the files and folders directly inside that folder.

    RecursionType.Full examines the full tree; if you passed in $/CmdLine/parser.cs you will get all files called parser.cs inside $/CmdLine or any folder under it.

    A deletion ID is assigned for the item. If the item is not deleted, pass 0. Every deleted item has a non-zero deletion ID that is required to identify that item (since one folder may contain multiple deleted items with the same name).

  • version
    Type: Microsoft.TeamFoundation.VersionControl.Client.VersionSpec

    The version of the passed item. (This is not necessarily the version numbers of the getd items. For instance, if you do a recursive GetItems on version 12 of $/CmdLine, you may get version 84 of $/CmdLine/parse.cs, and version 1 of $/CmdLine/output.cs, and so on.) Use VersionSpec.Latest to get the current version of all items.

  • deletedState
    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 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.)

  • includeDownloadInfo
    Type: System.Boolean

    If you set includeDownloadInfo to true, the returned Item objects will contain information required to download files. This makes the initial GetItems call slower, so should only be used if you want to download files using the returned objects.

Return Value

Type: Microsoft.TeamFoundation.VersionControl.Client.ItemSet
The returned 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.

Remarks

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

.NET Framework Security

See Also

Reference

VersionControlServer Class

VersionControlServer Members

GetItems Overload

Microsoft.TeamFoundation.VersionControl.Client Namespace