LedSourceIdUtility
public static class LedSourceIdUtilityCreates deterministic, normalized board-local IDs for runtime content sources and ports.
Methods
Section titled “Methods”
Sanitize(string)
Section titled “Sanitize(string)”public static string Sanitize(string value)Converts a label into a lowercase source ID containing letters, digits, and single underscore separators.
Parameters
| Name | Type |
|---|---|
value |
System.String |
Returns
System.String: An empty string when no usable characters remain.
SanitizeOrDefault(string, string)
Section titled “SanitizeOrDefault(string, string)”public static string SanitizeOrDefault(string value, string fallback)Creates a valid source ID from a preferred value, then a fallback, then the built-in source ID.
Parameters
| Name | Type |
|---|---|
value |
System.String |
fallback |
System.String |
Returns
System.String
CreateReadableId(string, string, bool)
Section titled “CreateReadableId(string, string, bool)”public static string CreateReadableId(string hint, string fallback, bool appendUniqueSuffix)Creates a readable source ID and optionally appends a short random suffix for runtime uniqueness.
Parameters
| Name | Type | Description |
|---|---|---|
hint |
System.String | Preferred human-readable basis for the ID. |
fallback |
System.String | Basis used when hint contains no usable characters. |
appendUniqueSuffix |
System.Boolean | Whether to append six hexadecimal characters from a new GUID. |
Returns
System.String