TaxonomySession.GetTermsWithCustomProperty method (String, Int32, Boolean)

Gets Term objects from all TermStore objects that have a property with the provided property name.

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

Syntax

'Declaration
Public Function GetTermsWithCustomProperty ( _
    customPropertyName As String, _
    resultCollectionSize As Integer, _
    trimUnavailable As Boolean _
) As TermCollection
'Usage
Dim instance As TaxonomySession
Dim customPropertyName As String
Dim resultCollectionSize As Integer
Dim trimUnavailable As Boolean
Dim returnValue As TermCollection

returnValue = instance.GetTermsWithCustomProperty(customPropertyName, _
    resultCollectionSize, trimUnavailable)
public TermCollection GetTermsWithCustomProperty(
    string customPropertyName,
    int resultCollectionSize,
    bool trimUnavailable
)

Parameters

  • resultCollectionSize
    Type: System.Int32

    The maximum number of Term objects to return from each TermStore.

  • trimUnavailable
    Type: System.Boolean

    yes if it trims the unavailable Term objects from the result collection; no if it includes the unavailable Term objects in the result collection.

Return value

Type: Microsoft.SharePoint.Taxonomy.TermCollection
A collection of Term objects.

Remarks

Only TermSet objects that are not scoped to a SPSite object and TermSet objects that are scoped to current site are searched.

The search results are returned directly from the TermStore object. The TermStore object may not be synchronized with changes that have been made but not committed. For best results, call the CommitAll() method or call the RollbackAll() method before calling this method.

See also

Reference

TaxonomySession class

TaxonomySession members

GetTermsWithCustomProperty overload

Microsoft.SharePoint.Taxonomy namespace