CategoryNameAttribute class
namespace: Serenity.ComponentModel assembly: Serenity.Net.Core
Specifies the category name for a property or class. Unlike CategoryAttribute, it can specify a local text key.
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface)]
public class CategoryNameAttribute : CategoryAttribute, IHasTextKey
Public Members
| name | description |
|---|---|
| CategoryNameAttribute() | Initializes a new instance of the CategoryNameAttribute class with no category name. Only useful when you want to specify the category name later through the TextKey property. |
| CategoryNameAttribute(…) | Initializes a new instance of the CategoryNameAttribute class with the specified category name. |
| TextKey { get; set; } | Gets or sets the local text key for the category. |
Examples
[CategoryName("My Display Text", TextKey = "My.Text.Key")] // with key and invariant text [CategoryName(TextKey = "My.Text.Key")] // with only key and no text [CategoryName("My Display Text")] // with only invariant text, no key [CategoryName("Db.Text.Key")] // still with only invariant text, no key unlike CategoryAttribute.
See Also
- interface IHasTextKey
- Source: CategoryNameAttribute.cs