TypeLibFuncAttribute クラス
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
COM タイプ ライブラリからこのメソッド用に元来インポートされた FUNCFLAGS を格納します。
public ref class TypeLibFuncAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, Inherited=false)]
public sealed class TypeLibFuncAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class TypeLibFuncAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, Inherited=false)>]
type TypeLibFuncAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, Inherited=false)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type TypeLibFuncAttribute = class
inherit Attribute
Public NotInheritable Class TypeLibFuncAttribute
Inherits Attribute
- 継承
- 属性
次の例では、メソッドの値を取得する TypeLibFuncAttribute 方法を示します。
using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::InteropServices;
ref class ClassC
{
private:
static bool IsHiddenMethod( MethodInfo^ mi )
{
array<Object^>^MethodAttributes = mi->GetCustomAttributes( TypeLibFuncAttribute::typeid, true );
if ( MethodAttributes->Length > 0 )
{
TypeLibFuncAttribute^ tlf = dynamic_cast<TypeLibFuncAttribute^>(MethodAttributes[ 0 ]);
TypeLibFuncFlags flags = tlf->Value;
return (flags & TypeLibFuncFlags::FHidden) != (TypeLibFuncFlags)0;
}
return false;
}
};
using System.Reflection;
using System.Runtime.InteropServices;
namespace C
{
class ClassC
{
public static bool IsHiddenMethod(MethodInfo mi)
{
object[] MethodAttributes = mi.GetCustomAttributes(typeof(TypeLibFuncAttribute), true);
if (MethodAttributes.Length > 0)
{
TypeLibFuncAttribute tlf = (TypeLibFuncAttribute)MethodAttributes[0];
TypeLibFuncFlags flags = tlf.Value;
return (flags & TypeLibFuncFlags.FHidden) != 0;
}
return false;
}
}
}
Imports System.Reflection
Imports System.Runtime.InteropServices
Module C
Public Function IsHiddenMethod(ByVal mi As MethodInfo) As Boolean
Dim MethodAttributes As Object() = mi.GetCustomAttributes(GetType(TypeLibFuncAttribute), True)
If MethodAttributes.Length > 0 Then
Dim tlf As TypeLibFuncAttribute = MethodAttributes(0)
Dim flags As TypeLibFuncFlags = tlf.Value
Return (flags & TypeLibFuncFlags.FHidden) > 0
End If
Return False
End Function
End Module
Tlbimp.exe (タイプ ライブラリ インポーター) は、この属性をメソッドに適用します。
この属性は、タイプ ライブラリがインポートされるときに適用され、変更しないでください。 メソッド FUNCFLAGS が 0 以外に評価された場合にのみ適用されます。 属性は、元 FUNCFLAGS の設定方法を知る必要があるツールで使用するように設計されています。 共通言語ランタイムでは、この属性は使用されません。
Type |
指定した TypeLibFuncFlags 値を使用して、 |
Type |
指定した TypeLibFuncFlags 値を使用して、 |
Type |
派生クラスで実装されると、この Attribute の一意の識別子を取得します。 (継承元 Attribute) |
Value |
このメソッドの TypeLibFuncFlags 値を取得します。 |
Equals(Object) |
このインスタンスが、指定されたオブジェクトと等価であるかどうかを示す値を返します。 (継承元 Attribute) |
Get |
このインスタンスのハッシュ コードを返します。 (継承元 Attribute) |
Get |
現在のインスタンスの Type を取得します。 (継承元 Object) |
Is |
派生クラスでオーバーライドされるとき、このインスタンスの値が派生クラスの既定値であるかどうかを示します。 (継承元 Attribute) |
Match(Object) |
派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (継承元 Attribute) |
Memberwise |
現在の Object の簡易コピーを作成します。 (継承元 Object) |
To |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |
_Attribute. |
一連の名前を対応する一連のディスパッチ識別子に割り当てます。 (継承元 Attribute) |
_Attribute. |
オブジェクトの型情報を取得します。この情報はインターフェイスの型情報の取得に使用できます。 (継承元 Attribute) |
_Attribute. |
オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。 (継承元 Attribute) |
_Attribute. |
オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。 (継承元 Attribute) |
製品 | バージョン |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.1 |
.NET に関するフィードバック
.NET はオープンソース プロジェクトです。 フィードバックを提供するにはリンクを選択します。