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

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

この属性をマネージ クラスに適用すると、COM コネクション ポイントとしてクラスが公開しているイベント インターフェイスを識別できます。イベント インターフェイスは、クラスのイベント メンバに割り当てられるメソッドを格納しています。クラス イベント名とインターフェイス メソッド名は同じにする必要があります。この属性は、ソース インターフェイスの型を適切なコンストラクタに渡すことによって、クラスあたり最大 4 つのソース インターフェイスを受け入れることができます。コンストラクタは、1 つから 4 つの間の型引数を受け取ります。4 つを超えるソース インターフェイスを公開する必要があるクラスでは、文字列バージョンのコンストラクタを使用できます。.NET イベントを COM クライアントに公開する方法の詳細については、「方法 : COM シンクによって処理されるイベントを発生させる」を参照してください。

名前空間とイベント シンク インターフェイスを渡して ComSourceInterfacesAttribute を適用することにより、イベント シンク インターフェイスをクラスに接続する方法を次の例に示します。
Imports System.Runtime.InteropServices <ComSourceInterfacesAttribute("ButtonEventsLib.ButtonEvents, ButtonEventsLib")> _ public Class Baz 'Insert code here. End Class
using System.Runtime.InteropServices; [ComSourceInterfacesAttribute("ButtonEventsLib.ButtonEvents, ButtonEventsLib")] public class Baz { //Insert code here. }
using namespace System::Runtime::InteropServices; [ComSourceInterfacesAttribute("ButtonEventsLib.ButtonEvents, ButtonEventsLib")] public ref class Baz{};

System.Attribute
System.Runtime.InteropServices.ComSourceInterfacesAttribute


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


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

- ComSourceInterfacesAttribute クラスのページへのリンク