| 1 | #nullable enable |
| 2 | |
| 3 | namespace CascadeIDE.ArchitectureAnalyzers; |
| 4 | |
| 5 | internal static class ArchitectureLayerPaths |
| 6 | { |
| 7 | public static bool IsFeaturesApplicationPath(string? filePath) |
| 8 | { |
| 9 | if (string.IsNullOrWhiteSpace(filePath)) |
| 10 | return false; |
| 11 | var n = Normalize(filePath); |
| 12 | return n.Contains("/Features/", StringComparison.OrdinalIgnoreCase) |
| 13 | && n.Contains("/Application/", StringComparison.OrdinalIgnoreCase); |
| 14 | } |
| 15 | |
| 16 | public static bool IsComputingUnitFilePath(string? filePath) |
| 17 | { |
| 18 | if (string.IsNullOrWhiteSpace(filePath)) |
| 19 | return false; |
| 20 | return Normalize(filePath).Contains("/Cockpit/ComputingUnits/", StringComparison.OrdinalIgnoreCase); |
| 21 | } |
| 22 | |
| 23 | public static bool IsViewModelsPath(string? filePath) |
| 24 | { |
| 25 | if (string.IsNullOrWhiteSpace(filePath)) |
| 26 | return false; |
| 27 | return Normalize(filePath).Contains("/ViewModels/", StringComparison.OrdinalIgnoreCase); |
| 28 | } |
| 29 | |
| 30 | public static bool IsMainWindowPresentationPartial(string? filePath) |
| 31 | { |
| 32 | if (string.IsNullOrWhiteSpace(filePath)) |
| 33 | return false; |
| 34 | var n = Normalize(filePath); |
| 35 | return n.EndsWith("/MainWindowViewModel.Presentation.cs", StringComparison.OrdinalIgnoreCase); |
| 36 | } |
| 37 | |
| 38 | private static string Normalize(string filePath) => filePath.Replace('\\', '/'); |
| 39 | } |
| 40 | |
View only · write via MCP/CIDE