Forge
csharpdeeb25a2
1using System.Globalization;
2using Avalonia.Data.Converters;
3using CascadeIDE.Models;
4
5namespace CascadeIDE.Views;
6
7/// <summary>Краткий значок строки таблицы по уровню лампы (галочка / предупреждение / …).</summary>
8public sealed class AnnunciatorLampLevelToGlyphTextConverter : IValueConverter
9{
10 public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
11 {
12 if (value is not AnnunciatorLampLevel level)
13 return "·";
14
15 return level switch
16 {
17 AnnunciatorLampLevel.Ok => "✓",
18 AnnunciatorLampLevel.Caution => "⚠",
19 AnnunciatorLampLevel.Advisory => "ℹ",
20 AnnunciatorLampLevel.Critical => "✕",
21 _ => "·"
22 };
23 }
24
25 public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) =>
26 throw new NotSupportedException();
27}
28
View only · write via MCP/CIDE