Share via


ExtensionManager.TryGetSingleExtension<TInterfaceType> Method

Tries to acquire a single extension for <TInterfaceType>. If multiple extensions are found or if no extension is found, or if the <TInterfaceType> supports multiple extensions, the method returns False and ExtensionHandle, an out parameter, is null.

Namespace:  Microsoft.Data.Schema.Extensibility
Assembly:  Microsoft.Data.Schema (in Microsoft.Data.Schema.dll)

Syntax

'Declaration
Public Function TryGetSingleExtension(Of TInterfaceType As {Class, IExtension}) ( _
    <OutAttribute> ByRef extensionHandle As ExtensionHandle(Of TInterfaceType) _
) As Boolean
'Usage
Dim instance As ExtensionManager 
Dim extensionHandle As ExtensionHandle(Of TInterfaceType)
Dim returnValue As Boolean 

returnValue = instance.TryGetSingleExtension(extensionHandle)
public bool TryGetSingleExtension<TInterfaceType>(
    out ExtensionHandle<TInterfaceType> extensionHandle
)
where TInterfaceType : class, IExtension
public:
generic<typename TInterfaceType>
where TInterfaceType : ref class, IExtension 
bool TryGetSingleExtension(
    [OutAttribute] ExtensionHandle<TInterfaceType>^% extensionHandle
)
JScript does not support generic types or methods.

Type Parameters

  • TInterfaceType

Parameters

  • extensionHandle
    Type: Microsoft.Data.Schema.Extensibility.ExtensionHandle<TInterfaceType>%

    [T:Microsoft.VisualStudio.TeamSystem.Data.Extensibility.ExtensionHandle<TInterfaceType>] is the ExtensionHandle object that implements the <TInterfaceType> interface.

Return Value

Type: System.Boolean
Boolean returns False if multiple extensions are found or if no extension is found, or if the <TInterfaceType> supports multiple extensions and the ExtensionHandle will be set to null.

.NET Framework Security

See Also

Reference

ExtensionManager Class

ExtensionManager Members

Microsoft.Data.Schema.Extensibility Namespace