Compartilhar via


TermStore.GetTermSets Method (String , Int32)

This method retrieves a collection of all TermSets in this TermStore that the current user has permissions to read that contain terms with labels matching or starting with each of the specified strings for a specified LCID.

Namespace:  Microsoft.SharePoint.Taxonomy
Assembly:  Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)

Syntax

'Declaration
Public Function GetTermSets ( _
    requiredTermLabels As String(), _
    lcid As Integer _
) As TermSetCollection
'Usage
Dim instance As TermStore
Dim requiredTermLabels As String()
Dim lcid As Integer
Dim returnValue As TermSetCollection

returnValue = instance.GetTermSets(requiredTermLabels, _
    lcid)
public TermSetCollection GetTermSets(
    string[] requiredTermLabels,
    int lcid
)

Parameters

  • requiredTermLabels
    Type: []

    A set of labels to match against the Term.Labels of each TermSet

  • lcid
    Type: System.Int32

    The locale identifier for the language of the Term.Labels to perform that matching upon

Return Value

Type: Microsoft.SharePoint.Taxonomy.TermSetCollection
A collection of all TermSets in this TermStore that the current user has permissions to read that contain terms with labels matching or starting with each of the specified strings for a specified LCID

Exceptions

Exception Condition
ArgumentNullException

The requiredTermLabels value cannot be null.

ArgumentNullException

The labels in requiredTermLabels cannot be null or empty.

ArgumentException

The value of one or more labels in requiredTermLabels is invalid. It probably contains invalid characters or is too long.

ArgumentOutOfRangeException

The lcid value must be one of the working languages in the current term store.

Remarks

The value of the labels in requiredTermLabels cannot be null or empty, and must not exceed 255 characters in length. They also cannot contain any of the following illegal characters ; " < > | & tab The lcid value must be one of the working languages of the term store, specified by TermStore.Languages. The search is case-insensitive. A TermSet will be included in the returned collection if, for each label value in requiredTermLabels, the TermSet contains a Term with a label that matches or starts with the value for the specified lcid. There is no requirement for a single Term to contain all of the specified labels. To get the most accurate results it is recommended that any pending changes be committed to the database using CommitAll() prior to executing this search.

See Also

Reference

TermStore Class

TermStore Members

GetTermSets Overload

Microsoft.SharePoint.Taxonomy Namespace

Labels

GetTermSets(String, Int32)

GetTermSets([])