Class ActivityAttribute
- Namespace
- Excalibur.Application.Requests
- Assembly
- Excalibur.Application.dll
Specifies a custom display name and description for an activity. When applied to a class implementing IActivity, the attribute values override the convention-based defaults derived from the type name.
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public sealed class ActivityAttribute : Attribute
- Inheritance
-
ActivityAttribute
- Inherited Members
Examples
// Display name only (description uses convention default)
[Activity("Submit Order")]
public class PlaceOrderCommand : CommandBase { }
// Both display name and description
[Activity("Submit Order", "Submits a new order for processing")]
public class PlaceOrderCommand : CommandBase { }
Constructors
ActivityAttribute(string)
Initializes a new instance of the ActivityAttribute class with the specified display name.
public ActivityAttribute(string displayName)
Parameters
displayNamestringThe human-readable display name for the activity.
ActivityAttribute(string, string)
Initializes a new instance of the ActivityAttribute class with the specified display name and description.
public ActivityAttribute(string displayName, string description)
Parameters
displayNamestringThe human-readable display name for the activity.
descriptionstringA description of the activity's purpose.
Properties
Description
Gets the description for the activity, or null if only a display name was provided.
public string? Description { get; }
Property Value
DisplayName
Gets the display name for the activity.
public string DisplayName { get; }
Property Value
- string
The human-readable display name.