InterfaceTypeAttribute クラス
アセンブリ: mscorlib (mscorlib.dll 内)

<AttributeUsageAttribute(AttributeTargets.Interface, Inherited:=False)> _ <ComVisibleAttribute(True)> _ Public NotInheritable Class InterfaceTypeAttribute Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Interface, Inherited=false)] [ComVisibleAttribute(true)] public sealed class InterfaceTypeAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Interface, Inherited=false)] [ComVisibleAttribute(true)] public ref class InterfaceTypeAttribute sealed : public Attribute

タイプ ライブラリ エクスポータ (Tlbexp.exe) は既定では、マネージ インターフェイスをデュアル インターフェイスとして COM に公開します。これによって、遅延バインディングの柔軟性と事前バインディングのパフォーマンスを得ることができます。ComInterfaceType 列挙体を使用すると、既定の動作をオーバーライドして、遅延バインディングだけ、または事前バインディングだけを指定できます。たとえば、InterfaceType (ComInterfaceType.InterfaceIsIDispatch) をインターフェイスに適用すると、呼び出し元を遅延バインディングだけに制限するメタデータを生成できます。IDispatch インターフェイスから継承したインターフェイスの多くはデュアル インターフェイスですが、InterfaceIsIDispatch 列挙体メンバを使用すると、インターフェイスのメソッドに対して遅延バインディング呼び出しだけを許可できます。この属性は、インターフェイスのマネージ ビューには影響を与えません。インターフェイスを COM に公開する方法の詳細については、「エクスポート時の型の変換」を参照してください。
タイプ ライブラリ インポータ (Tlbimp.exe) はまた、インポートされた非デュアル インターフェイスにこの属性を適用します。適切な列挙体メンバを適用することによって、インターフェイスがディスパッチ専用か IUnknown 専用かを示します。

InterfaceTypeAttribute でインターフェイスを COM に公開する方法を制御する方法を次の例に示します。
Imports System.Runtime.InteropServices 'Interface is exposed to COM as dual. Interface IMyInterface1 'Insert code here. End Interface 'Interface is exposed to COM as IDispatch. <InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)> _ Interface IMyInterface2 'Insert code here. End Interface
using System.Runtime.InteropServices; //Interface is exposed to COM as dual. interface IMyInterface1 { //Insert code here. } //Interface is exposed to COM as IDispatch. [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] interface IMyInterface2 { //Insert code here. }
using namespace System::Runtime::InteropServices; //Interface is exposed to COM as dual. interface class IMyInterface1{}; //Insert code here. //Interface is exposed to COM as IDispatch. [InterfaceTypeAttribute(ComInterfaceType::InterfaceIsIDispatch)] interface class IMyInterface2{}; //Insert code here.
import System.Runtime.InteropServices.*; //Interface is exposed to COM as dual. interface IMyInterface1 { //Insert code here. } //IMyInterface1 //Interface is exposed to COM as IDispatch. /** @attribute InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch) */ interface IMyInterface2 { //Insert code here. } //IMyInterface2

System.Attribute
System.Runtime.InteropServices.InterfaceTypeAttribute


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


InterfaceTypeAttribute コンストラクタ (ComInterfaceType)
アセンブリ: mscorlib (mscorlib.dll 内)

Public Sub New ( _ interfaceType As ComInterfaceType _ )
Dim interfaceType As ComInterfaceType Dim instance As New InterfaceTypeAttribute(interfaceType)
public InterfaceTypeAttribute ( ComInterfaceType interfaceType )
public: InterfaceTypeAttribute ( ComInterfaceType interfaceType )
public InterfaceTypeAttribute ( ComInterfaceType interfaceType )
public function InterfaceTypeAttribute ( interfaceType : ComInterfaceType )


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


InterfaceTypeAttribute コンストラクタ (Int16)
アセンブリ: mscorlib (mscorlib.dll 内)

Public Sub New ( _ interfaceType As Short _ )
Dim interfaceType As Short Dim instance As New InterfaceTypeAttribute(interfaceType)
public InterfaceTypeAttribute ( short interfaceType )
public: InterfaceTypeAttribute ( short interfaceType )
public InterfaceTypeAttribute ( short interfaceType )
public function InterfaceTypeAttribute ( interfaceType : short )

このコンストラクタは、ComInterfaceType 列挙体の各メンバを表す、基になる 16 ビット整数値を受け取ります。タイプ ライブラリ インポータ (Tlbimp.exe) は、このコンストラクタを使用します。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


InterfaceTypeAttribute コンストラクタ

名前 | 説明 |
---|---|
InterfaceTypeAttribute (ComInterfaceType) | 指定した ComInterfaceType 列挙体メンバを使用して、InterfaceTypeAttribute クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
InterfaceTypeAttribute (Int16) | 指定した ComInterfaceType 列挙体メンバを使用して、InterfaceTypeAttribute クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |

InterfaceTypeAttribute プロパティ

名前 | 説明 | |
---|---|---|
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。) |
![]() | Value | インターフェイスを COM に公開する方法を記述する ComInterfaceType 値を取得します。 |

InterfaceTypeAttribute メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 ( Attribute から継承されます。) |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 ( Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 ( Attribute から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 ( Attribute から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 ( Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 ( Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 ( Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

InterfaceTypeAttribute メンバ
COM への公開時に、マネージ インターフェイスがデュアル、ディスパッチ専用、または IUnknown 専用のいずれであるかを示します。
InterfaceTypeAttribute データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。) |
![]() | Value | インターフェイスを COM に公開する方法を記述する ComInterfaceType 値を取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 ( Attribute から継承されます。) |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 (Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 (Attribute から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 (Attribute から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 (Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 (Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

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

- InterfaceTypeAttributeのページへのリンク