Specifies that a method is a keyword. If the name of the keyword is not specified the name of the annotated method is used as the keyword name.
[AttributeUsageAttribute(AttributeTargets.Method)] public class KeywordAttribute : Attribute
'Declaration <AttributeUsageAttribute(AttributeTargets.Method> Public Class KeywordAttribute Inherits Attribute
| Name | Description |
|---|---|
| Name Property (KeywordAttribute) | Gets the name of the keyword. The default value is an empty string. |
| Description Property (KeywordAttribute) | Gets the description of the keyword. The default value is an empty string. |
Use the following code sample to create the keyword Login with the arguments username and password:
[Keyword]
public void Login(string username, string password) {
// keyword implementation
}
<Keyword()> Public Sub Login(username As String, password As String) ' keyword implementation End Sub
To specify the keyword name when creating a new keyword, use the following code sample:
[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