Provides canonical Gameptics class-name formatting and preset-name resolution. Keeps all class-list string operations in one source-agnostic place. Stays independent from any concrete UI framework. More...
Static Public Member Functions | |
| static string | NormalizeClassName (string className) |
| Normalizes one class name before matching or storing it. Empty, null, and whitespace-only values become an empty string. Non-empty values are trimmed without changing case or internal characters. | |
| static string[] | SplitClassNames (string classNames) |
| Splits a whitespace-separated class-list string into stable unique class names. Empty fragments are ignored and duplicate class names are removed. Returned values preserve the first-seen order after normalization. | |
| static string | JoinClassNames (IEnumerable< string > classNames) |
| Joins class names into one normalized whitespace-separated class-list string. Empty values are ignored and duplicate class names are removed. The resulting string preserves the first-seen order after normalization. | |
| static string[] | NormalizeClassNames (IEnumerable< string > classNames) |
| Normalizes an enumerable of class names into stable unique tokens. Values may contain whitespace-separated class lists and are split automatically. Empty values are ignored and duplicates are removed while preserving first-seen order. | |
| static bool | ContainsClassName (string classNames, string className) |
| Checks whether a class-list string contains one normalized class name. The comparison is exact after trimming and does not ignore case. Empty input to match against always returns false. | |
| static bool | ContainsAnyClassName (string classNames, params string[] classNamesToCheck) |
| Checks whether a class-list string contains at least one class from the provided set. Empty candidate names are ignored during normalization. The method returns false when no valid candidate class names remain. | |
| static bool | ContainsAllClassNames (string classNames, params string[] classNamesToCheck) |
| Checks whether a class-list string contains all classes from the provided set. Empty candidate names are ignored during normalization. The method returns false when no valid candidate class names remain. | |
| static string | AddClassName (string classNames, string className) |
| Adds one class name to a class-list string in an idempotent way. Empty input is ignored and existing class names are not duplicated. The returned class-list string stays normalized and stable. | |
| static string | RemoveClassName (string classNames, string className) |
| Removes one class name from a class-list string in an idempotent way. Empty input is ignored and missing class names are left unchanged. The returned class-list string stays normalized and stable. | |
| static string | SetClassName (string classNames, string className, bool enabled) |
| Enables or disables one class name inside a class-list string. Empty input class names are ignored and the existing list is still normalized. The returned class-list string stays stable and free from duplicates. | |
| static bool | ContainsPresetClassName (string classNames, GamepticPresetId preset) |
| Checks whether a class-list string contains the built-in preset class for the given preset. The preset is converted through the canonical Gameptics class-name rules. Matching stays exact after normalization. | |
| static bool | TryGetPresetFromClassName (string className, out GamepticPresetId preset) |
| Tries to resolve one class name as a built-in Gameptics preset class. Only canonical built-in preset class names are recognized. Non-preset or invalid class names return false. | |
| static bool | TryGetPresetFromClassNames (string classNames, out GamepticPresetId preset) |
| Tries to resolve the first built-in preset class found inside a class-list string. Class names are inspected in stable normalized order from left to right. Non-preset classes are skipped automatically. | |
| static string | RemovePresetClassNames (string classNames) |
| Removes all built-in preset classes from a class-list string. Non-preset classes are preserved in their original normalized order. The returned class-list string stays stable and free from duplicates. | |
| static string | WithSinglePresetClassName (string classNames, GamepticPresetId preset) |
| Replaces all built-in preset classes in a class-list string with one canonical preset class. Non-preset classes are preserved in their original normalized order. The resulting class-list string contains exactly one built-in preset class. | |
| static string | BuildPresetClassName (GamepticPresetId preset) |
| Builds the canonical class name for a built-in Gameptics preset. Known preset values use a cached mapping shared by all helper methods. Unknown enum values still follow the same formatting convention. | |
| static string | ToKebabCase (string value) |
| Converts a PascalCase or camelCase identifier into lowercase kebab-case text. A dash is inserted before uppercase letters that follow a lowercase letter or a digit. Null or empty values return an empty string. | |
Static Public Attributes | |
| const string | PresetClassPrefix = "gameptics-" |
Prefix used by all built-in Gameptics preset class names. The preset identifier is appended in lowercase kebab-case form after this prefix. GamepticPresetId.Selection therefore becomes gameptics-selection. | |
Provides canonical Gameptics class-name formatting and preset-name resolution. Keeps all class-list string operations in one source-agnostic place. Stays independent from any concrete UI framework.