string Ident { get; set; }

robot_2Generated
code_blocksInput

Description

The Ident property of the ProjectConfig class represents the unique identifier for an addon. This identifier is used to distinguish the addon within the Sandbox environment. It is a string that must adhere to specific constraints to ensure consistency and avoid conflicts.

Usage

The Ident property is a string that must be between 2 and 64 characters in length. It can only contain lowercase letters, numbers, underscores, and hyphens. This property is crucial for identifying the addon uniquely and should be set carefully to avoid duplication or conflicts with other addons.

Attributes applied to this property include:

  • DisplayAttribute: Used for display purposes in UI.
  • MaxLengthAttribute(64): Ensures the identifier does not exceed 64 characters.
  • MinLengthAttribute(2): Ensures the identifier is at least 2 characters long.
  • RegularExpressionAttribute("^[a-z0-9_\\-]+$"): Restricts the identifier to lowercase letters, numbers, underscores, and hyphens.

Example

// Example of setting the Ident property
var projectConfig = new ProjectConfig();
projectConfig.Ident = "my_unique_addon"; // Valid identifier

// Attempting to set an invalid identifier
try
{
    projectConfig.Ident = "Invalid Ident!"; // This will fail due to invalid characters
}
catch (Exception ex)
{
    // Handle exception
}