FlagsAttribute FlagsAttribute FlagsAttribute FlagsAttribute Class

定義

列挙体をビット フィールド、つまりフラグのセットとして扱えることを示します。Indicates that an enumeration can be treated as a bit field; that is, a set of flags.

public ref class FlagsAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Enum, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class FlagsAttribute : Attribute
type FlagsAttribute = class
    inherit Attribute
Public Class FlagsAttribute
Inherits Attribute
継承
FlagsAttributeFlagsAttributeFlagsAttributeFlagsAttribute
属性

使用例を次に示します、FlagsAttribute属性し、に対する効果を示します、ToStringメソッドを使用してのFlagsAttribute上、Enum宣言します。The following example illustrates the use of the FlagsAttribute attribute and shows the effect on the ToString method of using FlagsAttribute on an Enum declaration.

using namespace System;

// Define an Enum without FlagsAttribute.
public enum class SingleHue : short
{
   None = 0,
   Black = 1,
   Red = 2,
   Green = 4,
   Blue = 8
};

// Define an Enum with FlagsAttribute.
[FlagsAttribute]
enum class MultiHue : short
{
   None = 0,
   Black = 1,
   Red = 2,
   Green = 4,
   Blue = 8
};

int main()
{
   // Display all possible combinations of values.
   Console::WriteLine(
        "All possible combinations of values without FlagsAttribute:");
   for (int val = 0; val <= 16; val++)
      Console::WriteLine("{0,3} - {1:G}", val, (SingleHue)val);
      
   Console::WriteLine(
        "\nAll possible combinations of values with FlagsAttribute:");
   
   // Display all combinations of values, and invalid values.
   for (int val = 0; val <= 16; val++ )
      Console::WriteLine("{0,3} - {1:G}", val, (MultiHue)val);
}
// The example displays the following output:
//       All possible combinations of values without FlagsAttribute:
//         0 - None
//         1 - Black
//         2 - Red
//         3 - 3
//         4 - Green
//         5 - 5
//         6 - 6
//         7 - 7
//         8 - Blue
//         9 - 9
//        10 - 10
//        11 - 11
//        12 - 12
//        13 - 13
//        14 - 14
//        15 - 15
//        16 - 16
//       
//       All possible combinations of values with FlagsAttribute:
//         0 - None
//         1 - Black
//         2 - Red
//         3 - Black, Red
//         4 - Green
//         5 - Black, Green
//         6 - Red, Green
//         7 - Black, Red, Green
//         8 - Blue
//         9 - Black, Blue
//        10 - Red, Blue
//        11 - Black, Red, Blue
//        12 - Green, Blue
//        13 - Black, Green, Blue
//        14 - Red, Green, Blue
//        15 - Black, Red, Green, Blue
//        16 - 16
using System;

class Example
{
   // Define an Enum without FlagsAttribute.
   enum SingleHue : short
   {
      None = 0,
      Black = 1,
      Red = 2,
      Green = 4,
      Blue = 8
   };

   // Define an Enum with FlagsAttribute.
   [FlagsAttribute] 
   enum MultiHue : short
   {
      None = 0,
      Black = 1,
      Red = 2,
      Green = 4,
      Blue = 8
   };

   static void Main( )
   {
      // Display all possible combinations of values.
      Console.WriteLine( 
           "All possible combinations of values without FlagsAttribute:");
      for(int val = 0; val <= 16; val++ )
         Console.WriteLine( "{0,3} - {1:G}", val, (SingleHue)val);

      // Display all combinations of values, and invalid values.
      Console.WriteLine( 
           "\nAll possible combinations of values with FlagsAttribute:");
      for( int val = 0; val <= 16; val++ )
         Console.WriteLine( "{0,3} - {1:G}", val, (MultiHue)val);
   } 
} 
// The example displays the following output:
//       All possible combinations of values without FlagsAttribute:
//         0 - None
//         1 - Black
//         2 - Red
//         3 - 3
//         4 - Green
//         5 - 5
//         6 - 6
//         7 - 7
//         8 - Blue
//         9 - 9
//        10 - 10
//        11 - 11
//        12 - 12
//        13 - 13
//        14 - 14
//        15 - 15
//        16 - 16
//       
//       All possible combinations of values with FlagsAttribute:
//         0 - None
//         1 - Black
//         2 - Red
//         3 - Black, Red
//         4 - Green
//         5 - Black, Green
//         6 - Red, Green
//         7 - Black, Red, Green
//         8 - Blue
//         9 - Black, Blue
//        10 - Red, Blue
//        11 - Black, Red, Blue
//        12 - Green, Blue
//        13 - Black, Green, Blue
//        14 - Red, Green, Blue
//        15 - Black, Red, Green, Blue
//        16 - 16
Module Example
   ' Define an Enum without FlagsAttribute.
   Enum SingleHue As Short
      None = 0
      Black = 1
      Red = 2
      Green = 4
      Blue = 8
   End Enum

   ' Define an Enum with FlagsAttribute.
   <FlagsAttribute> 
   Enum MultiHue As Short
      None = 0
      Black = 1
      Red = 2
      Green = 4
      Blue = 8
   End Enum

   Sub Main()
      ' Display all possible combinations of values.
      Console.WriteLine(
           "All possible combinations of values without FlagsAttribute:")
      For val As Integer = 0 To 16
         Console.WriteLine("{0,3} - {1:G}", val, CType(val, SingleHue))
     Next 
     Console.WriteLine()
     
     ' Display all combinations of values, and invalid values.
     Console.WriteLine( 
          "All possible combinations of values with FlagsAttribute:")
     For val As Integer = 0 To 16
        Console.WriteLine( "{0,3} - {1:G}", val, CType(val, MultiHue))
     Next 
   End Sub 
End Module 
' The example displays the following output:
'       All possible combinations of values without FlagsAttribute:
'         0 - None
'         1 - Black
'         2 - Red
'         3 - 3
'         4 - Green
'         5 - 5
'         6 - 6
'         7 - 7
'         8 - Blue
'         9 - 9
'        10 - 10
'        11 - 11
'        12 - 12
'        13 - 13
'        14 - 14
'        15 - 15
'        16 - 16
'       
'       All possible combinations of values with FlagsAttribute:
'         0 - None
'         1 - Black
'         2 - Red
'         3 - Black, Red
'         4 - Green
'         5 - Black, Green
'         6 - Red, Green
'         7 - Black, Red, Green
'         8 - Blue
'         9 - Black, Blue
'        10 - Red, Blue
'        11 - Black, Red, Blue
'        12 - Green, Blue
'        13 - Black, Green, Blue
'        14 - Red, Green, Blue
'        15 - Black, Red, Green, Blue
'        16 - 16

次の例は、2 つの色関連の列挙を定義します。SingleHueMultiHueします。The following example defines two color-related enumerations, SingleHue and MultiHue. 後者の場合は、FlagsAttribute属性。 前者はありません。The latter has the FlagsAttribute attribute; the former does not. 列挙型の基になる値ではない整数を含む整数の範囲は、列挙型、および表示文字列表現にキャストするときは、動作の違いを示します。The example shows the difference in behavior when a range of integers, including integers that do not represent underlying values of the enumeration type, are cast to the enumeration type and their string representations displayed. たとえば、3 として表すことができないことに注意してください、 SingleHue 3 は、いずれかの基になる値ではないため、その値SingleHueメンバー、一方、FlagsAttribute属性では、3 として表すことが、MultiHueの値Black, RedFor example, note that 3 cannot be represented as a SingleHue value because 3 is not the underlying value of any SingleHue member, whereas the FlagsAttribute attribute makes it possible to represent 3 as a MultiHue value of Black, Red.

using namespace System;

[FlagsAttribute] enum class PhoneService
{
   None = 0,
   LandLine = 1,
   Cell = 2,
   Fax = 4,
   Internet = 8,
   Other = 16
};

void main()
{
   // Define three variables representing the types of phone service
   // in three households.
   PhoneService household1 = PhoneService::LandLine | PhoneService::Cell |
                             PhoneService::Internet;
   PhoneService household2 = PhoneService::None;
   PhoneService household3 = PhoneService::Cell | PhoneService::Internet;

   // Store the variables in an array for ease of access.
   array<PhoneService>^ households = { household1, household2, household3 };

   // Which households have no service?
   for (int ctr = 0; ctr < households->Length; ctr++)
      Console::WriteLine("Household {0} has phone service: {1}",
                         ctr + 1,
                         households[ctr] == PhoneService::None ?
                             "No" : "Yes");
   Console::WriteLine();

   // Which households have cell phone service?
   for (int ctr = 0; ctr < households->Length; ctr++)
      Console::WriteLine("Household {0} has cell phone service: {1}",
                         ctr + 1,
                         (households[ctr] & PhoneService::Cell) == PhoneService::Cell ?
                            "Yes" : "No");
   Console::WriteLine();

   // Which households have cell phones and land lines?
   PhoneService cellAndLand = PhoneService::Cell | PhoneService::LandLine;
   for (int ctr = 0; ctr < households->Length; ctr++)
      Console::WriteLine("Household {0} has cell and land line service: {1}",
                         ctr + 1,
                         (households[ctr] & cellAndLand) == cellAndLand ?
                            "Yes" : "No");
   Console::WriteLine();

   // List all types of service of each household?//
   for (int ctr = 0; ctr < households->Length; ctr++)
      Console::WriteLine("Household {0} has: {1:G}",
                         ctr + 1, households[ctr]);
   Console::WriteLine();
}
// The example displays the following output:
//    Household 1 has phone service: Yes
//    Household 2 has phone service: No
//    Household 3 has phone service: Yes
//
//    Household 1 has cell phone service: Yes
//    Household 2 has cell phone service: No
//    Household 3 has cell phone service: Yes
//
//    Household 1 has cell and land line service: Yes
//    Household 2 has cell and land line service: No
//    Household 3 has cell and land line service: No
//
//    Household 1 has: LandLine, Cell, Internet
//    Household 2 has: None
//    Household 3 has: Cell, Internet
using System;

[FlagsAttribute] public enum PhoneService
{
   None = 0,
   LandLine = 1,
   Cell = 2,
   Fax = 4,
   Internet = 8,
   Other = 16
}

public class Example
{
   public static void Main()
   {
      // Define three variables representing the types of phone service
      // in three households.
      var household1 = PhoneService.LandLine | PhoneService.Cell |
                       PhoneService.Internet;
      var household2 = PhoneService.None;
      var household3 = PhoneService.Cell | PhoneService.Internet;

      // Store the variables in an array for ease of access.
      PhoneService[] households = { household1, household2, household3 };

      // Which households have no service?
      for (int ctr = 0; ctr < households.Length; ctr++)
         Console.WriteLine("Household {0} has phone service: {1}",
                           ctr + 1,
                           households[ctr] == PhoneService.None ?
                               "No" : "Yes");
      Console.WriteLine();

      // Which households have cell phone service?
      for (int ctr = 0; ctr < households.Length; ctr++)
         Console.WriteLine("Household {0} has cell phone service: {1}",
                           ctr + 1,
                           (households[ctr] & PhoneService.Cell) == PhoneService.Cell ?
                              "Yes" : "No");
      Console.WriteLine();

      // Which households have cell phones and land lines?
      var cellAndLand = PhoneService.Cell | PhoneService.LandLine;
      for (int ctr = 0; ctr < households.Length; ctr++)
         Console.WriteLine("Household {0} has cell and land line service: {1}",
                           ctr + 1,
                           (households[ctr] & cellAndLand) == cellAndLand ?
                              "Yes" : "No");
      Console.WriteLine();

      // List all types of service of each household?//
      for (int ctr = 0; ctr < households.Length; ctr++)
         Console.WriteLine("Household {0} has: {1:G}",
                           ctr + 1, households[ctr]);
      Console.WriteLine();
   }
}
// The example displays the following output:
//    Household 1 has phone service: Yes
//    Household 2 has phone service: No
//    Household 3 has phone service: Yes
//
//    Household 1 has cell phone service: Yes
//    Household 2 has cell phone service: No
//    Household 3 has cell phone service: Yes
//
//    Household 1 has cell and land line service: Yes
//    Household 2 has cell and land line service: No
//    Household 3 has cell and land line service: No
//
//    Household 1 has: LandLine, Cell, Internet
//    Household 2 has: None
//    Household 3 has: Cell, Internet
<FlagsAttribute> Public Enum PhoneService As Integer
   None = 0
   LandLine = 1
   Cell = 2
   Fax = 4
   Internet = 8
   Other = 16
End Enum

Module Example
   Public Sub Main()
      ' Define three variables representing the types of phone service
      ' in three households.
      Dim household1 As PhoneService = PhoneService.LandLine Or
                                       PhoneService.Cell Or
                                       PhoneService.Internet
      Dim household2 As PhoneService = PhoneService.None
      Dim household3 As PhoneService = PhoneService.Cell Or
                                       PhoneService.Internet

      ' Store the variables in an array for ease of access.
      Dim households() As PhoneService = { household1, household2,
                                           household3 }

      ' Which households have no service?
      For ctr As Integer = 0 To households.Length - 1
         Console.WriteLine("Household {0} has phone service: {1}",
                           ctr + 1,
                           If(households(ctr) = PhoneService.None,
                              "No", "Yes"))
      Next
      Console.WriteLine()
      
      ' Which households have cell phone service?
      For ctr As Integer = 0 To households.Length - 1
         Console.WriteLine("Household {0} has cell phone service: {1}",
                           ctr + 1,
                           If((households(ctr) And PhoneService.Cell) = PhoneService.Cell,
                              "Yes", "No"))
      Next
      Console.WriteLine()
      
      ' Which households have cell phones and land lines?
      Dim cellAndLand As PhoneService = PhoneService.Cell Or PhoneService.LandLine
      For ctr As Integer = 0 To households.Length - 1
         Console.WriteLine("Household {0} has cell and land line service: {1}",
                           ctr + 1,
                           If((households(ctr) And cellAndLand) = cellAndLand,
                              "Yes", "No"))
      Next
      Console.WriteLine()
      
      ' List all types of service of each household?'
      For ctr As Integer = 0 To households.Length - 1
         Console.WriteLine("Household {0} has: {1:G}",
                           ctr + 1, households(ctr))
      Next
      Console.WriteLine()
   End Sub
End Module
' The example displays the following output:
'    Household 1 has phone service: Yes
'    Household 2 has phone service: No
'    Household 3 has phone service: Yes
'
'    Household 1 has cell phone service: Yes
'    Household 2 has cell phone service: No
'    Household 3 has cell phone service: Yes
'
'    Household 1 has cell and land line service: Yes
'    Household 2 has cell and land line service: No
'    Household 3 has cell and land line service: No
'
'    Household 1 has: LandLine, Cell, Internet
'    Household 2 has: None
'    Household 3 has: Cell, Internet

注釈

ビット フィールドは、相互に排他的な要素の一覧の列挙定数が使用される一般に対しを組み合わせて、要素の一覧については通常使用されます。Bit fields are generally used for lists of elements that might occur in combination, whereas enumeration constants are generally used for lists of mutually exclusive elements. そのため、ビット フィールドは、列挙定数でないが、名前のない値を生成するビットごとの OR 演算と組み合わせるに設計されています。Therefore, bit fields are designed to be combined with a bitwise OR operation to generate unnamed values, whereas enumerated constants are not. 言語は、列挙定数と比較して、ビット フィールドの使用によって異なります。Languages vary in their use of bit fields compared to enumeration constants.

FlagsAttribute 属性Attributes of the FlagsAttribute

AttributeUsageAttribute このクラスに適用し、そのInheritedプロパティを指定しますfalseします。AttributeUsageAttribute is applied to this class, and its Inherited property specifies false. この属性は、列挙型にのみ適用できます。This attribute can only be applied to enumerations.

FlagsAttribute 列挙型のガイドラインGuidelines for FlagsAttribute and Enum

  • 使用して、FlagsAttribute列挙体はビットごとの演算 (AND、OR の排他的 OR) は、数値に対して実行する場合にのみカスタム属性。Use the FlagsAttribute custom attribute for an enumeration only if a bitwise operation (AND, OR, EXCLUSIVE OR) is to be performed on a numeric value.

  • つまり、1、2、4、8、および具合 2 の累乗で、列挙定数を定義します。Define enumeration constants in powers of two, that is, 1, 2, 4, 8, and so on. これは、結合された列挙定数の個々 のフラグが重複しないことを意味します。This means the individual flags in combined enumeration constants do not overlap.

  • 一般的に使用されるフラグの組み合わせの列挙型の定数を作成することを検討してください。Consider creating an enumerated constant for commonly used flag combinations. たとえば、ファイル I/O 操作のための列挙体がある場合を含む列挙型定数Read = 1Write = 2、列挙型の定数を作成すること検討ReadWrite = Read OR Writeを組み合わせる、ReadWriteフラグ。For example, if you have an enumeration used for file I/O operations that contains the enumerated constants Read = 1 and Write = 2, consider creating the enumerated constant ReadWrite = Read OR Write, which combines the Read and Write flags. さらに、フラグの組み合わせに使用されるビットごとの OR 演算に単純なタスクに必要なすべきいくつかの状況での高度な概念を考慮することがあります。In addition, the bitwise OR operation used to combine the flags might be considered an advanced concept in some circumstances that should not be required for simple tasks.

  • 多くのフラグの位置は 1 では、コードに混乱する可能性がありますし、コーディング エラーに設定する可能性がありますので、フラグ列挙型定数として負の数を定義する場合は、注意を使用します。Use caution if you define a negative number as a flag enumerated constant because many flag positions might be set to 1, which might make your code confusing and encourage coding errors.

  • 数値の値で、フラグが設定されているかどうかをテストする便利な方法は、数値の値と、フラグに対応していないゼロを数値にすべてのビットを設定するフラグの列挙型定数のビットごとの AND 演算を実行するには、し、その操作の結果がフラグ列挙型定数と等しいかどうかをテストします。A convenient way to test whether a flag is set in a numeric value is to perform a bitwise AND operation between the numeric value and the flag enumerated constant, which sets all bits in the numeric value to zero that do not correspond to the flag, then test whether the result of that operation is equal to the flag enumerated constant.

  • 使用Noneフラグの名前は列挙定数の値が 0 として。Use None as the name of the flag enumerated constant whose value is zero. 使用することはできません、Noneのため、結果は常に 0 フラグをテストするビットごとの AND 演算の列挙型定数。You cannot use the None enumerated constant in a bitwise AND operation to test for a flag because the result is always zero. ただし、行うことができます、論理、数値の間で、ビットごとの比較しないと、None数値の値のビットが設定されているかどうかを決定する列挙型定数。However, you can perform a logical, not a bitwise, comparison between the numeric value and the None enumerated constant to determine whether any bits in the numeric value are set.

    作成するには有用ですフラグ列挙体ではなく値の列挙体を作成する場合、None列挙型定数。If you create a value enumeration instead of a flags enumeration, it is still worthwhile to create a None enumerated constant. 理由は、既定では、列挙に使用されるメモリは 0 に初期化は、共通言語ランタイムによって。The reason is that by default the memory used for the enumeration is initialized to zero by the common language runtime. そのため、値が 0 の定数を定義していない場合、作成時に、列挙体は値が無効含まれます。Consequently, if you do not define a constant whose value is zero, the enumeration will contain an illegal value when it is created.

    アプリケーションを表す必要がある、明確な既定のケースがある場合は、値がゼロを既定値を表す列挙定数の使用を検討してください。If there is an obvious default case your application needs to represent, consider using an enumerated constant whose value is zero to represent the default. 既定のケースがない場合、他の列挙定数のいずれかで表されないケースの値は 0 です。 列挙型の定数を使用することを意味を検討してください。If there is no default case, consider using an enumerated constant whose value is zero that means the case that is not represented by any of the other enumerated constants.

  • 列挙型自体の状態を反映するためだけにする列挙値を定義しません。Do not define an enumeration value solely to mirror the state of the enumeration itself. たとえば、単なる列挙体の末尾を示す列挙型の定数を定義してください。For example, do not define an enumerated constant that merely marks the end of the enumeration. 列挙体の最後の値を決定する必要がある場合は、その値を明示的にチェックします。If you need to determine the last value of the enumeration, check for that value explicitly. さらに、範囲内のすべての値が有効な場合は、最初と最後の列挙型定数の範囲チェックを実行できます。In addition, you can perform a range check for the first and last enumerated constant if all values within the range are valid.

  • 将来使用するために予約されている列挙型定数は指定しません。Do not specify enumerated constants that are reserved for future use.

  • メソッドまたは列挙型定数の値を受け取るプロパティを定義するときに、値の検証を検討してください。When you define a method or property that takes an enumerated constant as a value, consider validating the value. 理由は、その数値の値が列挙体で定義されていない場合でも、数値の値を列挙型にキャストすることです。The reason is that you can cast a numeric value to the enumeration type even if that numeric value is not defined in the enumeration.

コンストラクター

FlagsAttribute() FlagsAttribute() FlagsAttribute() FlagsAttribute()

FlagsAttribute クラスの新しいインスタンスを初期化します。Initializes a new instance of the FlagsAttribute class.

メソッド

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

このインスタンスが、指定されたオブジェクトと等価であるかどうかを示す値を返します。Returns a value that indicates whether this instance is equal to a specified object.

(Inherited from Attribute)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

このインスタンスのハッシュ コードを返します。Returns the hash code for this instance.

(Inherited from Attribute)
GetType() GetType() GetType() GetType()

現在のインスタンスの Type を取得します。Gets the Type of the current instance.

(Inherited from Object)
IsDefaultAttribute() IsDefaultAttribute() IsDefaultAttribute() IsDefaultAttribute()

派生クラスでオーバーライドされるとき、このインスタンスの値が派生クラスの既定値であるかどうかを示します。When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.

(Inherited from Attribute)
Match(Object) Match(Object) Match(Object) Match(Object)

派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.

(Inherited from Attribute)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object.

(Inherited from Object)

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

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

一連の名前を対応する一連のディスパッチ識別子に割り当てます。Maps a set of names to a corresponding set of dispatch identifiers.

(Inherited from Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

オブジェクトの型情報を取得します。この情報はインターフェイスの型情報の取得に使用できます。Retrieves the type information for an object, which can be used to get the type information for an interface.

(Inherited from Attribute)
_Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(Inherited from Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。Provides access to properties and methods exposed by an object.

(Inherited from Attribute)

プロパティ

TypeId TypeId TypeId TypeId

派生クラスで実装されると、この Attribute の一意の識別子を取得します。When implemented in a derived class, gets a unique identifier for this Attribute.

(Inherited from Attribute)

適用対象