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

NameType
valueSystem.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

NameType
valueSystem.String
fallbackSystem.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

NameTypeDescription
hintSystem.StringPreferred human-readable basis for the ID.
fallbackSystem.StringBasis used when hint contains no usable characters.
appendUniqueSuffixSystem.BooleanWhether to append six hexadecimal characters from a new GUID.

Returns

System.String