Partager via


ServicingContext.TryGetItem<T> Method

Attempts to retrieve an item from the item bag.

Namespace:  Microsoft.TeamFoundation.Framework.Server
Assembly:  Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)

Syntax

'Declaration
Public Function TryGetItem(Of T) ( _
    itemName As String, _
    <OutAttribute> ByRef item As T _
) As Boolean
public bool TryGetItem<T>(
    string itemName,
    out T item
)
public:
generic<typename T>
bool TryGetItem(
    String^ itemName, 
    [OutAttribute] T% item
)
member TryGetItem : 
        itemName:string * 
        item:'T byref -> bool
JScript does not support generic types or methods.

Type Parameters

  • T
    The type of item.

Parameters

  • item
    Type: T%

    The item, cast to type T. In the failure case, the default value of T.

Return Value

Type: System.Boolean
True if the item is found, it is not null and it can be cast to type T.

.NET Framework Security

See Also

Reference

ServicingContext Class

Microsoft.TeamFoundation.Framework.Server Namespace