VersionControlServer.QueryLabels Method (String, String, String, Boolean, String, VersionSpec)
Gets a list of labels matching the specified filter parameters. A label in Team Foundation Server designates a collection of specific versions of files and folders. For example, the label Beta 1 may refer to the files server.cs, client.cs, om.cs, and command.cs as they were on March 3, and the file server.cs as it was on March 5. Internally, the label Beta 1 is stored as "server.cs version 12, client.cs version 26" and continues in this pattern. When you apply a label, it does not freeze development, but it does allow you to rebuild your project at a designated point in the past. Every label has a scope, and its name must be unique within that scope. Most commonly a label is scoped by Team Project. This means that within a given Team Project, there can be only one label called Beta 1. However, you can choose to scope a label at a lower level. If Beta 1 is scoped at $/CmdLine/shell, then there can be no other label called Beta 1 in $/CmdLine/shell or any folder below it; however, $/CmdLine/parser may use the same label.
Namespace: Microsoft.TeamFoundation.VersionControl.Client
Assembly: Microsoft.TeamFoundation.VersionControl.Client (in Microsoft.TeamFoundation.VersionControl.Client.dll)
Syntax
'Declaration
Public Function QueryLabels ( _
labelName As String, _
labelScope As String, _
owner As String, _
includeItems As Boolean, _
filterItem As String, _
versionFilterItem As VersionSpec _
) As VersionControlLabel()
'Usage
Dim instance As VersionControlServer
Dim labelName As String
Dim labelScope As String
Dim owner As String
Dim includeItems As Boolean
Dim filterItem As String
Dim versionFilterItem As VersionSpec
Dim returnValue As VersionControlLabel()
returnValue = instance.QueryLabels(labelName, _
labelScope, owner, includeItems, _
filterItem, versionFilterItem)
public VersionControlLabel[] QueryLabels(
string labelName,
string labelScope,
string owner,
bool includeItems,
string filterItem,
VersionSpec versionFilterItem
)
public:
array<VersionControlLabel^>^ QueryLabels(
String^ labelName,
String^ labelScope,
String^ owner,
bool includeItems,
String^ filterItem,
VersionSpec^ versionFilterItem
)
public function QueryLabels(
labelName : String,
labelScope : String,
owner : String,
includeItems : boolean,
filterItem : String,
versionFilterItem : VersionSpec
) : VersionControlLabel[]
Parameters
labelName
Type: System.StringThe name of the label that you want to query. Wildcards may be used.
If null is passed, all labels are returned.
labelScope
Type: System.StringThe function will search for labels which are scoped at, or below, this path. If null is passed, labels are returned no matter where they are scoped (this is equivalent to passing in $/).
owner
Type: System.StringThe person who created the label. If null is passed, labels are returned regardless of username.
includeItems
Type: System.BooleanIf this parameter is set to false, the Items array in the VersionControlLabel objects will be left empty, only metadata about the label itself will be returned. If this parameter is set to true, the function will return information about each item within the label.
filterItem
Type: System.StringOnly returns labels that contain this item. This string may represent 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. If null is passed, labels are returned regardless of the files and folders they include.
versionFilterItem
Type: Microsoft.TeamFoundation.VersionControl.Client.VersionSpecThe version of the specified filterItem. Pass VersionSpec.Latest to specify the current version. If filterItem is null, this parameter is ignored.
Return Value
Type: array<Microsoft.TeamFoundation.VersionControl.Client.VersionControlLabel[]
A VersionControlLabel object that contains the label information for each label selected by the query.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.