Skip to content

LedSourceIdUtility

ClassLEDStudioLEDStudio
public static class LedSourceIdUtility

Creates deterministic, normalized board-local IDs for runtime content sources and ports.

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.

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

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