Type.GetInterfaces メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As Type Dim returnValue As Type() returnValue = instance.GetInterfaces
public abstract Type[] GetInterfaces ()
public abstract Type[] GetInterfaces ()
現在の Type で実装または継承されているすべてのインターフェイスを表す Type オブジェクトの配列。 または 現在の Type で実装または継承されているインターフェイスが存在しない場合は、Type 型の空の配列。


現在の Type が構築ジェネリック型を表している場合、このメソッドは、型パラメータを適切な型の引数で置き換えて Type オブジェクトを返します。
現在の Type がジェネリック型定義またはジェネリック メソッド定義の型パラメータを表す場合、このメソッドはインターフェイス制約およびクラス制約またはインターフェイス制約から継承されたすべてのインターフェイスを検索します。

指定したクラスの型を取得し、その型が実装または継承しているすべてのインターフェイスを表示する例を示します。Visual Basic の例をコンパイルするには、次のコンパイラ コマンドを使用します。
vbc type_getinterfaces1.vb /r:System.Web.dll /r:System.dll
Imports System Imports System.Web Imports System.Web.UI Imports Microsoft.VisualBasic Namespace Samples Public Class MyTemplate Inherits Control Implements INamingContainer Private _message As [String] = Nothing Public Property Message() As [String] Get Return _message End Get Set(ByVal Value As [String]) _message = value End Set End Property End Class Public Class MyInterfacesSample Public Shared Sub Main() Try Dim myObjectArray As Type() = GetType(MyTemplate).GetInterfaces() Console.WriteLine("The interfaces inherited by the MyTemplate class are:" + ControlChars.CrLf) Dim index As Integer For index = 0 To myObjectArray.Length - 1 Console.WriteLine(myObjectArray(index)) Next index Catch e As Exception Console.WriteLine("An exception occurred.") Console.WriteLine("Message: {0}", e.Message) End Try End Sub End Class End Namespace
using System; using System.Web; using System.Web.UI; namespace Samples { public class MyTemplate : Control, INamingContainer { private String _message = null; public String Message { get { return _message; } set { _message = value; } } } public class MyInterfacesSample { public static void Main() { try { Type[] myObjectArray= typeof(MyTemplate).GetInterfaces(); Console.WriteLine("The interfaces inherited by the MyTemplate class are:\n"); for (int index = 0; index < myObjectArray.Length; index++) { Console.WriteLine(myObjectArray[index]); } } catch (Exception e) { Console.WriteLine("An exception occurred."); Console.WriteLine("Message: " + e.Message); } } } }
#using <system.dll> #using <system.web.dll> using namespace System; using namespace System::Web; using namespace System::Web::UI; public ref class MyTemplate: public Control, public INamingContainer { private: String^ _message; public: property String^ Message { String^ get() { return _message; } void set( String^ value ) { _message = value; } } }; int main() { try { array<Type^>^myObjectArray = MyTemplate::typeid->GetInterfaces(); Console::WriteLine( "The interfaces inherited by the MyTemplate class are:\n" ); for ( int index = 0; index < myObjectArray->Length; index++ ) { Console::WriteLine( myObjectArray[ index ] ); } } catch ( Exception^ e ) { Console::WriteLine( "An exception occurred." ); Console::WriteLine( "Message: {0}", e->Message ); } }
package Samples; import System.*; import System.Web.*; import System.Web.UI.*; public class MyTemplate extends Control implements INamingContainer { private String _message = null; /** @property */ public String get_Message() { return _message; } //get_Message /** @property */ public void set_Message(String value) { _message = value; } //set_Message } //MyTemplate public class MyInterfacesSample { public static void main(String[] args) { try { Type myObjectArray[] = MyTemplate.class.ToType().GetInterfaces(); Console.WriteLine("The interfaces inherited by the MyTemplate" + " class are:\n"); for (int index = 0; index < myObjectArray.length; index++) { Console.WriteLine(myObjectArray.get_Item(index)); } } catch (System.Exception e) { Console.WriteLine("An exception occurred."); Console.WriteLine("Message: " + e.get_Message()); } } //main } //MyInterfacesSample

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


_Type.GetInterfaces メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As _Type Dim returnValue As Type() returnValue = instance.GetInterfaces
現在の Type で実装または継承されているすべてのインターフェイスを表す Type オブジェクトの配列。 または 現在の Type で実装または継承されているインターフェイスが存在しない場合は、Type 型の空の配列。

このメソッドは、アンマネージ コードからマネージ クラスにアクセスするためのメソッドであるため、マネージ コードからは呼び出さないでください。
Type.GetInterfaces メソッドは、現在の Type で実装または継承されているすべてのインターフェイスを取得します。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からType.GetInterfacesを検索する場合は、下記のリンクをクリックしてください。

- Type.GetInterfacesのページへのリンク