AnnotatedObjectExtensions.GetAnnotation<T> Method (IAnnotatedObject, Object)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Gets an annotation using a key and returns result cast to type T.
Namespace: Microsoft.VisualStudio.SharePoint
Assembly: Microsoft.VisualStudio.SharePoint.Utilities (in Microsoft.VisualStudio.SharePoint.Utilities.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function GetAnnotation(Of T As Class) ( _
annotatedObject As IAnnotatedObject, _
key As Object _
) As T
'Usage
Dim annotatedObject As IAnnotatedObject
Dim key As Object
Dim returnValue As T
returnValue = annotatedObject.GetAnnotation(key)
public static T GetAnnotation<T>(
this IAnnotatedObject annotatedObject,
Object key
)
where T : class
Type Parameters
- T
Type of object to be returned.
Parameters
- annotatedObject
Type: Microsoft.VisualStudio.SharePoint.IAnnotatedObject
Object that has annotations.
- key
Type: System.Object
The annotation key to search for.
Return Value
Type: T
An instance of T if it is found; otherwise null.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IAnnotatedObject. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
.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.
See Also
Reference
AnnotatedObjectExtensions Class