AssemblyReferences.GetTypes 方法
這個 API 支援 .NET Framework 基礎結構,但您不可以直接在程式碼中使用它。
傳回參考組件集中的所有型別,而這些型別會衍生自或實作指定的基底型別。
命名空間: Microsoft.Windows.Design
組件: Microsoft.Windows.Design.Extensibility (在 Microsoft.Windows.Design.Extensibility.dll 中)
語法
'宣告
Public Function GetTypes ( _
baseType As Type _
) As IEnumerable(Of Type)
public IEnumerable<Type> GetTypes(
Type baseType
)
public:
IEnumerable<Type^>^ GetTypes(
Type^ baseType
)
member GetTypes :
baseType:Type -> IEnumerable<Type>
public function GetTypes(
baseType : Type
) : IEnumerable<Type>
參數
- baseType
型別:System.Type
所有傳回的型別應該衍生自的基底型別。如果 baseType 為介面,則所有傳回的型別就會實作此介面。
傳回值
型別:System.Collections.Generic.IEnumerable<Type>
型別的列舉。如果沒有相符的型別,則回傳回空的列舉。
例外狀況
例外狀況 | 條件 |
---|---|
ArgumentNullException | baseType 為 nullNull 參照 (即 Visual Basic 中的 Nothing)。 |
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。