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
itemName
Type: System.StringThe name of the item.
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
- 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.