メソッドがキーワードであることを指定します。キーワードの名前が指定されていない場合、アノテーション メソッドの名前がキーワード名として使用されます。
[AttributeUsageAttribute(AttributeTargets.Method)] public class KeywordAttribute : Attribute
'Declaration <AttributeUsageAttribute(AttributeTargets.Method> Public Class KeywordAttribute Inherits Attribute
| 名前 | 説明 |
|---|---|
| Name プロパティ (KeywordAttribute) | キーワードの名前を取得します。デフォルト値は空の文字列です。 |
| Description プロパティ (KeywordAttribute) | キーワードの説明を取得します。デフォルト値は空の文字列です。 |
引数 username および password を持つ Login キーワードを作成するには、次のサンプル コードを使用します。
[Keyword]
public void Login(string username, string password) {
// keyword implementation
}
<Keyword()> Public Sub Login(username As String, password As String) ' keyword implementation End Sub
新しいキーワードを作成するときにキーワードの名前を指定するには、次のサンプル コードを使用します。
[Keyword("Login user")]
public void Login(string username, string password) {
// keyword implementation
}
<Keyword("Login user")>
Public Sub Login(username As String, password As String)
' keyword implementation
End Sub