Type.Attributes プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

Public ReadOnly Property Attributes As TypeAttributes
public TypeAttributes Attributes { get; }
Type の属性セットを表す TypeAttributes オブジェクト。ただし、Type がジェネリック型パラメータを表す場合、値は未指定。

現在の Type が構築ジェネリック型を表している場合、このプロパティはジェネリック型の属性を返します。たとえば、MyGenericClass<int> (Visual Basic の場合は MyGenericClass(Of Integer)) に対して返される属性は、MyGenericClass<T> (Visual Basic の場合は MyGenericClass(Of T)) の属性です。
現在の Type がジェネリック型パラメータを表している場合、つまり、IsGenericParameter プロパティが true を返す場合は、このプロパティによって返される TypeAttributes 値は未指定です。

Type.Attributes プロパティを使用する例を次に示します。
Imports System Imports System.Reflection Public Class Class1 Protected t As Type Public Sub Method1() If t.Attributes And TypeAttributes.ClassSemanticsMask = TypeAttributes.Interface Then Console.WriteLine("t is an interface.") End If If t.Attributes And TypeAttributes.Public <> 0 Then Console.WriteLine("t is public.") End If End Sub 'Method1 End Class 'Class1
using System; using System.Reflection; public class Class1 { protected Type t; public void Method1() { if ((t.Attributes & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Interface) Console.WriteLine ("t is an interface."); if ((t.Attributes & TypeAttributes.Public) != 0) Console.WriteLine ("t is public."); } }
#using <System.DLL> using namespace System; using namespace System::Reflection; ref class Sample { private: void Method( Type^ t ) { if ( (t->Attributes & TypeAttributes::ClassSemanticsMask) == TypeAttributes::Interface ) Console::WriteLine( "t is an interface." ); if ( (t->Attributes & TypeAttributes::Public) != (TypeAttributes)0 ) Console::WriteLine( "t is public." ); } };
import System.*; import System.Reflection.*; public class Class1 { protected Type t; public void Method1() { if ((t.get_Attributes() & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Interface ) { Console.WriteLine("t is an interface."); } if (((int)(t.get_Attributes() & TypeAttributes.Public)) != 0 ) { Console.WriteLine("t is public."); } } //Method1 } //Class1

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


TypeAttributes 列挙体
この列挙体には、メンバ値のビットごとの組み合わせを可能にする FlagsAttribute 属性が含まれています。
名前空間: System.Reflectionアセンブリ: mscorlib (mscorlib.dll 内)

<SerializableAttribute> _ <ComVisibleAttribute(True)> _ <FlagsAttribute> _ Public Enumeration TypeAttributes
[SerializableAttribute] [ComVisibleAttribute(true)] [FlagsAttribute] public enum class TypeAttributes



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


_Type.Attributes プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

ReadOnly Property Attributes As TypeAttributes
TypeAttributes Attributes { get; }
property TypeAttributes Attributes { TypeAttributes get (); }
function get Attributes () : TypeAttributes
Type の属性セットを表す TypeAttributes オブジェクト。ただし、Type がジェネリック型パラメータを表す場合、値は未指定。


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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

- TypeAttributesのページへのリンク