TypeLibFuncAttribute クラス

定義

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
属性

次の例では、メソッドの値を取得する 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;
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 (タイプ ライブラリ インポーター) は、この属性をメソッドに適用します。

この属性は、タイプ ライブラリをインポートするときに適用され、変更しないでください。 メソッドが 0 以外に FUNCFLAGS 評価された場合にのみ適用されます。 この属性は、元 FUNCFLAGS の設定方法を知る必要があるツールで使用するように設計されています。 共通言語ランタイムでは、この属性は使用されません。

コンストラクター

TypeLibFuncAttribute(Int16)

指定した TypeLibFuncFlags 値を使用して、TypeLibFuncAttribute クラスの新しいインスタンスを初期化します。

TypeLibFuncAttribute(TypeLibFuncFlags)

指定した TypeLibFuncFlags 値を使用して、TypeLibFuncAttribute クラスの新しいインスタンスを初期化します。

プロパティ

TypeId

派生クラスで実装されると、この Attribute の一意の識別子を取得します。

(継承元 Attribute)
Value

このメソッドの TypeLibFuncFlags 値を取得します。

メソッド

Equals(Object)

このインスタンスが、指定されたオブジェクトと等価であるかどうかを示す値を返します。

(継承元 Attribute)
GetHashCode()

このインスタンスのハッシュ コードを返します。

(継承元 Attribute)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IsDefaultAttribute()

派生クラスでオーバーライドされるとき、このインスタンスの値が派生クラスの既定値であるかどうかを示します。

(継承元 Attribute)
Match(Object)

派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。

(継承元 Attribute)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

(継承元 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

オブジェクトの型情報を取得します。この情報はインターフェイスの型情報の取得に使用できます。

(継承元 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

(継承元 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。

(継承元 Attribute)

適用対象

こちらもご覧ください