EnumItemAttribute Class

Assembly: CodeEffects.Rule.Common.dll
Namespace: CodeEffects.Rule.Common.Attributes

Summary

When applied to a member of an enumeration that is used by a source object as a rule field, this attribute specifies the display name for that member.

Syntax

[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
public class EnumItemAttribute : System.Attribute

Constructors

  • EnumItemAttribute(string displayName)

    Initializes a new instance of the EnumItemAttribute class.

    Parameters

    • displayName (System.String) - The label that represents the enumeration member in the Rule Editor.

Properties

  • AiAliases

    Type: System.String[]

    Gets or sets other names an AI agent may know this enumeration member by: industry terms, abbreviations, or the names other systems use. Agents working with the Code Effects Rule Repository find the enumeration member by these as well as by its display name, and still call it by its display name. The aliases are never shown in the Rule Editor. They are stored with the source and sent to the AI provider the host uses, so they must hold nothing confidential. Changing them is a label change, not a new source version. This property is optional.

  • AiDescription

    Type: System.String

    Gets or sets what an AI agent should know about this enumeration member when it needs more than its display name: what it means and how it is used. It is never shown in the Rule Editor. It is stored with the source and sent to the AI provider the host uses, so it must hold nothing confidential. Changing it is a label change, not a new source version. This property is optional.

  • DisplayName

    Type: System.String

    Gets the display name of the enumeration member in the Rule Editor. The value is set by the constructor. If the attribute is not applied, the declared name of the member is used.

Example

using CodeEffects.Rule.Common.Attributes;

public enum State
{
	[ExcludeFromEvaluation]
	Undefined,

	Arizona,
	California,
	Florida,
	Georgia,

	[EnumItem("North Dakota")]
	NorthDakota,

	[EnumItem("South Carolina", AiAliases = new[] { "SC" })]
	SouthCarolina
}

Ask on Stack Overflow - Yes, it's still active
Ask in GitHub Discussions

p102

l097 --

l102

p101

×