csharpdeeb25a2 | 1 | using System.Collections.ObjectModel; |
| 2 | using CommunityToolkit.Mvvm.ComponentModel; |
| 3 | using CommunityToolkit.Mvvm.Input; |
| 4 | |
| 5 | namespace CascadeIDE.ViewModels; |
| 6 | public sealed partial class ProblemsPanelViewModel : ObservableObject |
| 7 | { |
| 8 | public int ErrorCount |
| 9 | { |
| 10 | get |
| 11 | { |
| 12 | var n = 0; |
| 13 | foreach (var i in Items) |
| 14 | { |
| 15 | if (string.Equals(i.Severity, "error", StringComparison.OrdinalIgnoreCase)) |
| 16 | n++; |
| 17 | } |
| 18 | |
| 19 | return n; |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | public int WarningCount |
| 24 | { |
| 25 | get |
| 26 | { |
| 27 | var n = 0; |
| 28 | foreach (var i in Items) |
| 29 | { |
| 30 | if (string.Equals(i.Severity, "warning", StringComparison.OrdinalIgnoreCase)) |
| 31 | n++; |
| 32 | } |
| 33 | |
| 34 | return n; |
| 35 | } |
| 36 | } |
| 37 | } |
View only · write via MCP/CIDE