csharpdeeb25a2 | 1 | #nullable enable |
| 2 | |
| 3 | namespace CascadeIDE.Views.SkiaKit; |
| 4 | |
| 5 | /// <summary>Расположение глифа валидации в slash pill (TCI).</summary> |
| 6 | internal enum SkiaStatusChipIconPlacement |
| 7 | { |
| 8 | Left = 0, |
| 9 | Right = 1, |
| 10 | /// <summary>Только рамка и акцентный текст, без глифа.</summary> |
| 11 | HighlightOnly = 2, |
| 12 | } |
| 13 | |
| 14 | internal static class TciValidationIconPlacementParser |
| 15 | { |
| 16 | public const string Left = "left"; |
| 17 | public const string Right = "right"; |
| 18 | public const string HighlightOnly = "highlight_only"; |
| 19 | |
| 20 | public static SkiaStatusChipIconPlacement Parse(string? value) |
| 21 | { |
| 22 | if (string.IsNullOrWhiteSpace(value)) |
| 23 | return SkiaStatusChipIconPlacement.Right; |
| 24 | |
| 25 | return value.Trim().ToLowerInvariant() switch |
| 26 | { |
| 27 | Left => SkiaStatusChipIconPlacement.Left, |
| 28 | Right => SkiaStatusChipIconPlacement.Right, |
| 29 | HighlightOnly => SkiaStatusChipIconPlacement.HighlightOnly, |
| 30 | _ => SkiaStatusChipIconPlacement.Right, |
| 31 | }; |
| 32 | } |
| 33 | } |
| 34 | |
View only · write via MCP/CIDE