TypeBuilder.GetInterface(String, Boolean) 方法
定義
傳回此類別所 (直接或間接) 實作的介面,且完整格式名稱符合指定的介面名稱。Returns the interface implemented (directly or indirectly) by this class with the fully qualified name matching the given interface name.
public:
override Type ^ GetInterface(System::String ^ name, bool ignoreCase);
public override Type? GetInterface (string name, bool ignoreCase);
public override Type GetInterface (string name, bool ignoreCase);
override this.GetInterface : string * bool -> Type
Public Overrides Function GetInterface (name As String, ignoreCase As Boolean) As Type
參數
- name
- String
介面的名稱。The name of the interface.
- ignoreCase
- Boolean
如果為 true
,搜尋不區分大小寫。If true
, the search is case-insensitive. 如果為 false
,搜尋會區分大小寫。If false
, the search is case-sensitive.
傳回
傳回 Type 物件,代表所實作的介面。Returns a Type object representing the implemented interface. 如果找不到符合名稱的介面,便傳回 null。Returns null if no interface matching name is found.
例外狀況
不會為不完整的類型實作此方法。This method is not implemented for incomplete types.
備註
使用或抓取型 Type.GetType 別 Assembly.GetType ,然後在抓取的型別上使用反映。Retrieve the type using Type.GetType or Assembly.GetType and use reflection on the retrieved type.