共用方式為


ExtensionManager.TryGetSingleExtension<TInterfaceType> 方法

嘗試取得所提供泛型型別的單一擴充。

命名空間:  Microsoft.Data.Schema.Extensibility
組件:  Microsoft.Data.Schema (在 Microsoft.Data.Schema.dll 中)

語法

'宣告
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 不支援泛型型別或方法。

型別參數

  • TInterfaceType
    衍生自 IExtension 介面的介面。

參數

傳回值

型別:System.Boolean
如果找到單一擴充則為 true,否則為 nullNull 參照 (即 Visual Basic 中的 Nothing)。

備註

如果找到多個副檔名或者沒有找到任何副檔名,或者如果 TInterfaceType 泛用參數支援多個副檔名,則此方法會傳回 false,extensionHandle (Out 參數) 則會是 nullNull 參照 (即 Visual Basic 中的 Nothing)。

.NET Framework 安全性

請參閱

參考

ExtensionManager 類別

Microsoft.Data.Schema.Extensibility 命名空間

IExtension

ExtensionHandle<TInterfaceType>