VersionControlServer.GetItem Method (String, VersionSpec, Int32)

This function is passed a string that represents a file or folder in Team Foundation Server, and returns an Item object that represents that item, but 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)

Syntax

'Declaration
Public Function GetItem ( _
    path As String, _
    version As VersionSpec, _
    deletionId As Integer _
) As Item
'Usage
Dim instance As VersionControlServer 
Dim path As String 
Dim version As VersionSpec 
Dim deletionId As Integer 
Dim returnValue As Item 

returnValue = instance.GetItem(path, version, _
    deletionId)
public Item GetItem(
    string path,
    VersionSpec version,
    int deletionId
)
public:
Item^ GetItem(
    String^ path, 
    VersionSpec^ version, 
    int deletionId
)
public function GetItem(
    path : String, 
    version : VersionSpec, 
    deletionId : int
) : Item

Parameters

  • path
    Type: System.String

    The file or folder that you want to get. 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 should not be passed here, they will cause an exception to occur.

  • deletionId
    Type: System.Int32

    Assigned deletion ID for the item. To get a non-deleted item, 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).

Return Value

Type: Microsoft.TeamFoundation.VersionControl.Client.Item
Returns the requested Item. If the Item is not found, an exception occurs.

Exceptions

Exception Condition
[ArgumentException]

An exception is thrown if there is a wildcard character in path.

[VersionControlException]

An exception is thrown if the item was not found.

.NET Framework Security

See Also

Reference

VersionControlServer Class

VersionControlServer Members

GetItem Overload

Microsoft.TeamFoundation.VersionControl.Client Namespace