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 should be set to a unique identifier for your addon. It must be between 2 and 64 characters in length and can only contain lowercase letters, numbers, underscores, and hyphens. This ensures that the identifier is valid and can be used reliably within the system.
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";
// Ensure the Ident is valid
if (projectConfig.Ident.Length >= 2 && projectConfig.Ident.Length <= 64 &&
System.Text.RegularExpressions.Regex.IsMatch(projectConfig.Ident, "^[a-z0-9_\\-]+$"))
{
// Ident is valid
}
else
{
// Handle invalid Ident
}