Share via


ExtensionManager.TryGetSingleExtension<TInterfaceType> Method

Tries to acquire a single extension of the provided Generic type.

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
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
)
member TryGetSingleExtension : 
        extensionHandle:ExtensionHandle<'TInterfaceType> byref -> bool  when 'TInterfaceType : not struct and IExtension
JScript does not support generic types or methods.

Type Parameters

  • TInterfaceType
    An interface that derives from the IExtension interface.

Parameters

Return Value

Type: System.Boolean
true if a single extension is found; otherwise, nulla null reference (Nothing in Visual Basic).

Remarks

If multiple extensions are found or if no extension is found, or if the TInterfaceType Generic parameter supports multiple extensions, the method returns false and the extensionHandle (an out parameter) is nulla null reference (Nothing in Visual Basic).

.NET Framework Security

See Also

Reference

ExtensionManager Class

Microsoft.Data.Schema.Extensibility Namespace

IExtension

ExtensionHandle<TInterfaceType>