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

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

この属性は、タイプ ライブラリをインポートするときに タイプ ライブラリ インポータ (Tlbimp.exe) が基本的に自動適用しますが、アセンブリに適用することもできます。
この属性の主な用途は、型情報の元の定義を取得することです。たとえば、A.tlb を相互運用機能アセンブリ A.dll としてインポートし、アセンブリ B.dll に A.dll を参照させることもできます。B.dll を B.tlb にエクスポートすると、この属性によって、A.dll を指す B.tlb 内の参照は代わりに A.tlb を指すようになります。これを、個々の型が COM で実装されていることを示す ComImportAttribute と混同しないよう注意してください。

Imports System Imports System.Reflection Imports System.Runtime.InteropServices Module A Public Function IsCOMAssembly(ByVal a As System.Reflection.Assembly) As Boolean Dim AsmAttributes As Object() = a.GetCustomAttributes(GetType(ImportedFromTypeLibAttribute), True) If AsmAttributes.Length = 1 Then Dim imptlb As ImportedFromTypeLibAttribute = AsmAttributes(0) Dim strImportedFrom As String = imptlb.Value ' Print out the the name of the DLL from which the assembly is imported. Console.WriteLine("Assembly " + a.FullName + " is imported from " + strImportedFrom) Return True End If ' This is not a COM assembly. Console.WriteLine("Assembly " + a.FullName + " is not imported from COM") Return False End Function End Module
using System; using System.Reflection; using System.Runtime.InteropServices; namespace A { class ClassA { public static bool IsCOMAssembly( Assembly a ) { object[] AsmAttributes = a.GetCustomAttributes( typeof( ImportedFromTypeLibAttribute ), true ); if( AsmAttributes.Length > 0 ) { ImportedFromTypeLibAttribute imptlb = ( ImportedFromTypeLibAttribute )AsmAttributes[0]; string strImportedFrom = imptlb.Value; // Print out the the name of the DLL from which the assembly is imported. Console.WriteLine( "Assembly " + a.FullName + " is imported from " + strImportedFrom ); return true; } // This is not a COM assembly. Console.WriteLine( "Assembly " + a.FullName + " is not imported from COM" ); return false; } } }
using namespace System; using namespace System::Reflection; using namespace System::Runtime::InteropServices; class ClassA { private: static bool IsCOMAssembly( Assembly^ a ) { array<Object^>^AsmAttributes = a->GetCustomAttributes( ImportedFromTypeLibAttribute::typeid, true ); if ( AsmAttributes->Length > 0 ) { ImportedFromTypeLibAttribute^ imptlb = dynamic_cast<ImportedFromTypeLibAttribute^>(AsmAttributes[ 0 ]); String^ strImportedFrom = imptlb->Value; // Print out the name of the DLL from which the assembly is imported. Console::WriteLine( "Assembly {0} is imported from {1}", a->FullName, strImportedFrom ); return true; } // This is not a COM assembly. Console::WriteLine( "Assembly {0} is not imported from COM", a->FullName ); return false; } };
import System.*; import System.Reflection.*; import System.Runtime.InteropServices.*; class ClassA { public static boolean IsCOMAssembly(Assembly a) { Object asmAttributes[] = a.GetCustomAttributes( ImportedFromTypeLibAttribute.class.ToType(), true); if (asmAttributes.length > 0) { ImportedFromTypeLibAttribute imptlb = (ImportedFromTypeLibAttribute)(asmAttributes.get_Item(0)); String strImportedFrom = imptlb.get_Value(); // Print out the the name of the DLL from which // the assembly is imported. Console.WriteLine("Assembly " + a.get_FullName() + " is imported from " + strImportedFrom); return true; } // This is not a COM assembly. Console.WriteLine("Assembly " + a.get_FullName() + " is not imported from COM"); return false; } //IsCOMAssembly } //ClassA

System.Attribute
System.Runtime.InteropServices.ImportedFromTypeLibAttribute


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


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


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


ImportedFromTypeLibAttribute プロパティ

名前 | 説明 | |
---|---|---|
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。) |
![]() | Value | 元のタイプ ライブラリ ファイルの名前を取得します。 |

ImportedFromTypeLibAttribute メソッド

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

ImportedFromTypeLibAttribute メンバ
アセンブリ内で定義された型が、タイプ ライブラリで初めに定義されたことを示します。
ImportedFromTypeLibAttribute データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() | ImportedFromTypeLibAttribute | 元のタイプ ライブラリ ファイルの名前を使用して、ImportedFromTypeLibAttribute クラスの新しいインスタンスを初期化します。 |

名前 | 説明 | |
---|---|---|
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。) |
![]() | Value | 元のタイプ ライブラリ ファイルの名前を取得します。 |

名前 | 説明 | |
---|---|---|
![]() | 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に収録されているすべての辞書からImportedFromTypeLibAttributeを検索する場合は、下記のリンクをクリックしてください。

- ImportedFromTypeLibAttributeのページへのリンク