StateMachineAttribute クラス
定義
メソッドがステート マシン メソッドであるかどうかを判断できます。Allows you to determine whether a method is a state machine method.
public ref class StateMachineAttribute : Attribute
public class StateMachineAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
public class StateMachineAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
[System.Serializable]
public class StateMachineAttribute : Attribute
type StateMachineAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)>]
type StateMachineAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)>]
[<System.Serializable>]
type StateMachineAttribute = class
inherit Attribute
Public Class StateMachineAttribute
Inherits Attribute
- 継承
- 派生
- 属性
注釈
StateMachine
属性をコード内のメソッドに適用することはできません。You should not apply the StateMachine
attribute to methods in your code. ステートマシンメソッドであるメソッドの場合、コンパイラは出力され AsyncStateMachineAttribute た IL にまたはを適用し IteratorStateMachineAttribute ます。For methods that are state machine methods, the compiler will apply the AsyncStateMachineAttribute or IteratorStateMachineAttribute in the emitted IL.
メソッドがステートマシンメソッドであるかどうかを確認する場合は、代わりに次の属性を確認することをお勧めします。これらの属性は、から派生し StateMachineAttribute
ます。When checking whether a method is a state machine method, it is preferable to instead check for following attributes, which are derived from StateMachineAttribute
:
注意
StateMachineAttribute
メソッドが C# の反復子メソッドの場合、メソッドがステートマシンメソッドであるかどうかを確認するために使用することはできません。StateMachineAttribute
cannot be used to check whether a method is a state machine method if the method is an iterator method in C#.
コンストラクター
StateMachineAttribute(Type) |
StateMachineAttribute クラスの新しいインスタンスを初期化します。Initializes a new instance of the StateMachineAttribute class. |
プロパティ
StateMachineType |
ステート マシン メソッドを実装するためにコンパイラによって生成された、基になるステート マシン型の型オブジェクトを返します。Returns the type object for the underlying state machine type that was generated by the compiler to implement the state machine method. |
TypeId |
派生クラスで実装されると、この Attribute の一意の識別子を取得します。When implemented in a derived class, gets a unique identifier for this Attribute. (継承元 Attribute) |
メソッド
Equals(Object) |
このインスタンスが、指定されたオブジェクトと等価であるかどうかを示す値を返します。Returns a value that indicates whether this instance is equal to a specified object. (継承元 Attribute) |
GetHashCode() |
このインスタンスのハッシュ コードを返します。Returns the hash code for this instance. (継承元 Attribute) |
GetType() |
現在のインスタンスの Type を取得します。Gets the Type of the current instance. (継承元 Object) |
IsDefaultAttribute() |
派生クラスでオーバーライドされるとき、このインスタンスの値が派生クラスの既定値であるかどうかを示します。When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (継承元 Attribute) |
Match(Object) |
派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (継承元 Attribute) |
MemberwiseClone() |
現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object. (継承元 Object) |
ToString() |
現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object. (継承元 Object) |
明示的なインターフェイスの実装
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
一連の名前を対応する一連のディスパッチ識別子に割り当てます。Maps a set of names to a corresponding set of dispatch identifiers. (継承元 Attribute) |
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) |
オブジェクトの型情報を取得します。この情報はインターフェイスの型情報の取得に使用できます。Retrieves the type information for an object, which can be used to get the type information for an interface. (継承元 Attribute) |
_Attribute.GetTypeInfoCount(UInt32) |
オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。Retrieves the number of type information interfaces that an object provides (either 0 or 1). (継承元 Attribute) |
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。Provides access to properties and methods exposed by an object. (継承元 Attribute) |