diff --git a/CSharpCodeAnalyst/App.xaml.cs b/CSharpCodeAnalyst/App.xaml.cs index 59cf9bb0..0d1952cf 100644 --- a/CSharpCodeAnalyst/App.xaml.cs +++ b/CSharpCodeAnalyst/App.xaml.cs @@ -2,17 +2,16 @@ using System.Windows; using CodeGraph.Exploration; using CodeParser.Parser; -using CSharpCodeAnalyst.Analyzers; -using CSharpCodeAnalyst.Areas.AdvancedSearchArea; -using CSharpCodeAnalyst.Areas.GraphArea; -using CSharpCodeAnalyst.Areas.InfoArea; -using CSharpCodeAnalyst.Areas.TreeArea; using CSharpCodeAnalyst.CommandLine; -using CSharpCodeAnalyst.Common; using CSharpCodeAnalyst.Configuration; -using CSharpCodeAnalyst.Messages; -using CSharpCodeAnalyst.Refactoring; +using CSharpCodeAnalyst.Features.AdvancedSearch; +using CSharpCodeAnalyst.Features.Analyzers; +using CSharpCodeAnalyst.Features.Graph; +using CSharpCodeAnalyst.Features.Info; +using CSharpCodeAnalyst.Features.Refactoring; +using CSharpCodeAnalyst.Features.Tree; using CSharpCodeAnalyst.Shared.Messages; +using CSharpCodeAnalyst.Shared.Notifications; using Microsoft.Extensions.Configuration; namespace CSharpCodeAnalyst; @@ -107,7 +106,7 @@ private void StartUi() var refactoringInteraction = new RefactoringInteraction(); var refactoringService = new RefactoringService(refactoringInteraction, messaging); - mainWindow.SetViewer(explorationGraphViewer); + mainWindow.SetViewer(explorationGraphViewer, messaging); var viewModel = new MainViewModel(messaging, applicationSettings, userSettings, analyzerManager, refactoringService); var graphViewModel = new GraphViewModel(explorationGraphViewer, explorer, messaging, applicationSettings, refactoringService); var treeViewModel = new TreeViewModel(messaging, refactoringService); diff --git a/CSharpCodeAnalyst/CSharpCodeAnalyst.csproj b/CSharpCodeAnalyst/CSharpCodeAnalyst.csproj index 3dc02b1e..15fb4600 100644 --- a/CSharpCodeAnalyst/CSharpCodeAnalyst.csproj +++ b/CSharpCodeAnalyst/CSharpCodeAnalyst.csproj @@ -16,27 +16,22 @@ - + MSBuild:Compile Wpf Designer - + MSBuild:Compile Wpf Designer - + MSBuild:Compile Wpf Designer - - MSBuild:Compile - Wpf - Designer - - + MSBuild:Compile diff --git a/CSharpCodeAnalyst/CommandLine/ConsoleValidationCommand.cs b/CSharpCodeAnalyst/CommandLine/ConsoleValidationCommand.cs index db744ece..71fd732b 100644 --- a/CSharpCodeAnalyst/CommandLine/ConsoleValidationCommand.cs +++ b/CSharpCodeAnalyst/CommandLine/ConsoleValidationCommand.cs @@ -3,11 +3,12 @@ using System.Text; using CodeParser.Parser; using CodeParser.Parser.Config; -using CSharpCodeAnalyst.Analyzers.ArchitecturalRules; -using CSharpCodeAnalyst.Common; using CSharpCodeAnalyst.Configuration; +using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.Contracts; +using CSharpCodeAnalyst.Shared.Messages; +using CSharpCodeAnalyst.Shared.Notifications; using Microsoft.Extensions.Configuration; namespace CSharpCodeAnalyst.CommandLine; diff --git a/CSharpCodeAnalyst/Constants.cs b/CSharpCodeAnalyst/Constants.cs deleted file mode 100644 index f97f6065..00000000 --- a/CSharpCodeAnalyst/Constants.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.Msagl.Drawing; - -namespace CSharpCodeAnalyst; - -public class Constants -{ - public const double TreeMinWidthCollapsed = 24; - public const double TreeMinWidthExpanded = 400; - public const int FlagLineWidth = 3; - public const int SearchHighlightLineWidth = 2; - public const double DefaultLineWidth = 1; - - - public const int MouseHighlightLineWidth = 3; - - public static Color FlagColor = Color.Red; - public static Color SearchHighlightColor = Color.Red; - public static Color DefaultLineColor = Color.Black; - - public static int DoubleClickMilliseconds = 350; - public static readonly Color GrayColor = Color.LightGray; - public static readonly Color MouseHighlightColor = Color.Red; -} \ No newline at end of file diff --git a/CSharpCodeAnalyst/Areas/AdvancedSearchArea/AdvancedSearchControl.xaml b/CSharpCodeAnalyst/Features/AdvancedSearch/AdvancedSearchControl.xaml similarity index 98% rename from CSharpCodeAnalyst/Areas/AdvancedSearchArea/AdvancedSearchControl.xaml rename to CSharpCodeAnalyst/Features/AdvancedSearch/AdvancedSearchControl.xaml index 43592802..4260464f 100644 --- a/CSharpCodeAnalyst/Areas/AdvancedSearchArea/AdvancedSearchControl.xaml +++ b/CSharpCodeAnalyst/Features/AdvancedSearch/AdvancedSearchControl.xaml @@ -1,9 +1,8 @@ - /// Orchestrates AI-assisted cycle analysis: builds the prompt, calls the LLM, returns the Markdown response. diff --git a/CSharpCodeAnalyst/Ai/AiAdvisorWindow.xaml b/CSharpCodeAnalyst/Features/Ai/AiAdvisorWindow.xaml similarity index 94% rename from CSharpCodeAnalyst/Ai/AiAdvisorWindow.xaml rename to CSharpCodeAnalyst/Features/Ai/AiAdvisorWindow.xaml index 700ca9e6..25aeeffc 100644 --- a/CSharpCodeAnalyst/Ai/AiAdvisorWindow.xaml +++ b/CSharpCodeAnalyst/Features/Ai/AiAdvisorWindow.xaml @@ -1,4 +1,4 @@ - /// Sends a single user prompt to an LLM endpoint and returns the response text. diff --git a/CSharpCodeAnalyst/Ai/AiClientException.cs b/CSharpCodeAnalyst/Features/Ai/AiClientException.cs similarity index 63% rename from CSharpCodeAnalyst/Ai/AiClientException.cs rename to CSharpCodeAnalyst/Features/Ai/AiClientException.cs index 79e225a5..7be47cfa 100644 --- a/CSharpCodeAnalyst/Ai/AiClientException.cs +++ b/CSharpCodeAnalyst/Features/Ai/AiClientException.cs @@ -1,3 +1,3 @@ -namespace CSharpCodeAnalyst.Ai; +namespace CSharpCodeAnalyst.Features.Ai; public class AiClientException(string message) : Exception(message); diff --git a/CSharpCodeAnalyst/Analyzers/AnalyzerManager.cs b/CSharpCodeAnalyst/Features/Analyzers/AnalyzerManager.cs similarity index 92% rename from CSharpCodeAnalyst/Analyzers/AnalyzerManager.cs rename to CSharpCodeAnalyst/Features/Analyzers/AnalyzerManager.cs index 18382cf3..7a0bce6d 100644 --- a/CSharpCodeAnalyst/Analyzers/AnalyzerManager.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/AnalyzerManager.cs @@ -1,8 +1,8 @@ -using CSharpCodeAnalyst.Analyzers.EventRegistration; -using CSharpCodeAnalyst.Common; +using CSharpCodeAnalyst.Features.Analyzers.EventRegistration; using CSharpCodeAnalyst.Shared.Contracts; +using CSharpCodeAnalyst.Shared.Notifications; -namespace CSharpCodeAnalyst.Analyzers; +namespace CSharpCodeAnalyst.Features.Analyzers; internal class AnalyzerManager : IAnalyzerManager { diff --git a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Analyzer.cs b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Analyzer.cs similarity index 97% rename from CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Analyzer.cs rename to CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Analyzer.cs index ee5ef4c6..66c4e2f9 100644 --- a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Analyzer.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Analyzer.cs @@ -2,13 +2,13 @@ using System.IO; using System.Text.Json; using System.Windows; -using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Presentation; -using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; -using CSharpCodeAnalyst.Common; +using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Presentation; +using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; using CSharpCodeAnalyst.Shared.Contracts; using CSharpCodeAnalyst.Shared.Messages; +using CSharpCodeAnalyst.Shared.Notifications; -namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules; +namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; public class Analyzer : IAnalyzer { diff --git a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/PatternMatcher.cs b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/PatternMatcher.cs similarity index 97% rename from CSharpCodeAnalyst/Analyzers/ArchitecturalRules/PatternMatcher.cs rename to CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/PatternMatcher.cs index 1decb69a..2a236a89 100644 --- a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/PatternMatcher.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/PatternMatcher.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules; +namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; public static class PatternMatcher { diff --git a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/PersistenceData.cs b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/PersistenceData.cs similarity index 57% rename from CSharpCodeAnalyst/Analyzers/ArchitecturalRules/PersistenceData.cs rename to CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/PersistenceData.cs index 89dda29c..8591395c 100644 --- a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/PersistenceData.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/PersistenceData.cs @@ -1,4 +1,4 @@ -namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules; +namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; public class PersistenceData { diff --git a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml similarity index 97% rename from CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml rename to CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml index 4588d44c..e325fe7a 100644 --- a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml +++ b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml @@ -1,4 +1,4 @@ - /// A line in the detail view. Note a view model is created for each source location in a relationship. diff --git a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml similarity index 97% rename from CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml rename to CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml index e418238d..b6f6b0d8 100644 --- a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml +++ b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml @@ -2,7 +2,7 @@ xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:presentation="clr-namespace:CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Presentation" + xmlns:presentation="clr-namespace:CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Presentation" mc:Ignorable="d"> GetData() public override DataTemplate? GetRowDetailsTemplate() { var uri = new Uri( - "/CSharpCodeAnalyst;component/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml", + "/CSharpCodeAnalyst;component/Features/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml", UriKind.Relative); return (DataTemplate)Application.LoadComponent(uri); } diff --git a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/RuleParser.cs b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/RuleParser.cs similarity index 96% rename from CSharpCodeAnalyst/Analyzers/ArchitecturalRules/RuleParser.cs rename to CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/RuleParser.cs index 9c0f5e80..d95d0cfe 100644 --- a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/RuleParser.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/RuleParser.cs @@ -1,8 +1,8 @@ using System.Text.RegularExpressions; -using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; using CSharpCodeAnalyst.Resources; -namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules; +namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; public static class RuleParser { diff --git a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/DenyRule.cs b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/DenyRule.cs similarity index 91% rename from CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/DenyRule.cs rename to CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/DenyRule.cs index ee7239c1..2ea429fa 100644 --- a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/DenyRule.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/DenyRule.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; /// /// Denies dependencies from source to target patterns diff --git a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/IsolateRule.cs b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/IsolateRule.cs similarity index 91% rename from CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/IsolateRule.cs rename to CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/IsolateRule.cs index ca73a2aa..06983717 100644 --- a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/IsolateRule.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/IsolateRule.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; /// /// Isolates source pattern from any external dependencies diff --git a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/RestrictRule.cs b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RestrictRule.cs similarity index 91% rename from CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/RestrictRule.cs rename to CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RestrictRule.cs index 61fafea3..b584936c 100644 --- a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/RestrictRule.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RestrictRule.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; /// /// Restricts source to only depend on target patterns (all others are denied) diff --git a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/RestrictRuleGroup.cs b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RestrictRuleGroup.cs similarity index 94% rename from CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/RestrictRuleGroup.cs rename to CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RestrictRuleGroup.cs index 4c3135a6..dfae1898 100644 --- a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/RestrictRuleGroup.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RestrictRuleGroup.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; /// /// Groups multiple RESTRICT rules with the same source pattern diff --git a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/RuleBase.cs b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RuleBase.cs similarity index 89% rename from CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/RuleBase.cs rename to CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RuleBase.cs index 7390cae4..ebf04f14 100644 --- a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Rules/RuleBase.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RuleBase.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; public abstract class RuleBase { diff --git a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Violation.cs b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Violation.cs similarity index 84% rename from CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Violation.cs rename to CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Violation.cs index 6bd04dd6..5fc7f118 100644 --- a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/Violation.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Violation.cs @@ -1,7 +1,7 @@ using CodeGraph.Graph; -using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; -namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules; +namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; public class Violation { diff --git a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/ViolationFormatter.cs b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/ViolationFormatter.cs similarity index 95% rename from CSharpCodeAnalyst/Analyzers/ArchitecturalRules/ViolationFormatter.cs rename to CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/ViolationFormatter.cs index d3ca23c0..92e279ec 100644 --- a/CSharpCodeAnalyst/Analyzers/ArchitecturalRules/ViolationFormatter.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/ViolationFormatter.cs @@ -1,6 +1,6 @@ using System.Text; -namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules; +namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; public static class ViolationsFormatter { diff --git a/CSharpCodeAnalyst/Analyzers/EventRegistration/Analyzer.cs b/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Analyzer.cs similarity index 94% rename from CSharpCodeAnalyst/Analyzers/EventRegistration/Analyzer.cs rename to CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Analyzer.cs index 0323a11f..24e88fe6 100644 --- a/CSharpCodeAnalyst/Analyzers/EventRegistration/Analyzer.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Analyzer.cs @@ -1,11 +1,11 @@ using CodeGraph.Graph; -using CSharpCodeAnalyst.Analyzers.EventRegistration.Presentation; +using CSharpCodeAnalyst.Features.Analyzers.EventRegistration.Presentation; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.Contracts; using CSharpCodeAnalyst.Shared.Messages; using CSharpCodeAnalyst.Shared.UI; -namespace CSharpCodeAnalyst.Analyzers.EventRegistration; +namespace CSharpCodeAnalyst.Features.Analyzers.EventRegistration; /// /// Finds imbalances between event registrations and un-registrations. diff --git a/CSharpCodeAnalyst/Analyzers/EventRegistration/Presentation/EventImbalanceViewModel.cs b/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/EventImbalanceViewModel.cs similarity index 92% rename from CSharpCodeAnalyst/Analyzers/EventRegistration/Presentation/EventImbalanceViewModel.cs rename to CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/EventImbalanceViewModel.cs index 2f9743ac..a850350d 100644 --- a/CSharpCodeAnalyst/Analyzers/EventRegistration/Presentation/EventImbalanceViewModel.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/EventImbalanceViewModel.cs @@ -5,9 +5,9 @@ using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; using CSharpCodeAnalyst.Shared.Services; -using CSharpCodeAnalyst.Wpf; +using CSharpCodeAnalyst.Shared.Wpf; -namespace CSharpCodeAnalyst.Analyzers.EventRegistration.Presentation; +namespace CSharpCodeAnalyst.Features.Analyzers.EventRegistration.Presentation; public class EventImbalanceViewModel : TableRow { diff --git a/CSharpCodeAnalyst/Analyzers/EventRegistration/Presentation/EventImbalancesViewModel.cs b/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/EventImbalancesViewModel.cs similarity index 85% rename from CSharpCodeAnalyst/Analyzers/EventRegistration/Presentation/EventImbalancesViewModel.cs rename to CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/EventImbalancesViewModel.cs index 5abadb0e..18ce1434 100644 --- a/CSharpCodeAnalyst/Analyzers/EventRegistration/Presentation/EventImbalancesViewModel.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/EventImbalancesViewModel.cs @@ -3,7 +3,7 @@ using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; -namespace CSharpCodeAnalyst.Analyzers.EventRegistration.Presentation; +namespace CSharpCodeAnalyst.Features.Analyzers.EventRegistration.Presentation; internal class EventImbalancesViewModel : Table { @@ -37,7 +37,7 @@ public override ObservableCollection GetData() public override DataTemplate? GetRowDetailsTemplate() { var uri = new Uri( - "/CSharpCodeAnalyst;component/Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml", + "/CSharpCodeAnalyst;component/Features/Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml", UriKind.Relative); return (DataTemplate)Application.LoadComponent(uri); } diff --git a/CSharpCodeAnalyst/Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml b/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml similarity index 100% rename from CSharpCodeAnalyst/Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml rename to CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml diff --git a/CSharpCodeAnalyst/Analyzers/EventRegistration/Result.cs b/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Result.cs similarity index 84% rename from CSharpCodeAnalyst/Analyzers/EventRegistration/Result.cs rename to CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Result.cs index 495dc349..58ab04f9 100644 --- a/CSharpCodeAnalyst/Analyzers/EventRegistration/Result.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Result.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Analyzers.EventRegistration; +namespace CSharpCodeAnalyst.Features.Analyzers.EventRegistration; public class Result { diff --git a/CSharpCodeAnalyst/Areas/CycleGroupsArea/CycleGroupViewModel.cs b/CSharpCodeAnalyst/Features/CycleGroups/CycleGroupViewModel.cs similarity index 97% rename from CSharpCodeAnalyst/Areas/CycleGroupsArea/CycleGroupViewModel.cs rename to CSharpCodeAnalyst/Features/CycleGroups/CycleGroupViewModel.cs index 7c5f0e23..017116ab 100644 --- a/CSharpCodeAnalyst/Areas/CycleGroupsArea/CycleGroupViewModel.cs +++ b/CSharpCodeAnalyst/Features/CycleGroups/CycleGroupViewModel.cs @@ -1,11 +1,11 @@ using System.Collections.ObjectModel; using CodeGraph.Algorithms.Cycles; using CodeGraph.Graph; -using CSharpCodeAnalyst.Areas.Shared; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.Shared.UI; -namespace CSharpCodeAnalyst.Areas.CycleGroupsArea; +namespace CSharpCodeAnalyst.Features.CycleGroups; internal class CycleGroupViewModel : TableRow { diff --git a/CSharpCodeAnalyst/Areas/CycleGroupsArea/CycleGroupsViewModel.cs b/CSharpCodeAnalyst/Features/CycleGroups/CycleGroupsViewModel.cs similarity index 91% rename from CSharpCodeAnalyst/Areas/CycleGroupsArea/CycleGroupsViewModel.cs rename to CSharpCodeAnalyst/Features/CycleGroups/CycleGroupsViewModel.cs index 645ff081..709fd282 100644 --- a/CSharpCodeAnalyst/Areas/CycleGroupsArea/CycleGroupsViewModel.cs +++ b/CSharpCodeAnalyst/Features/CycleGroups/CycleGroupsViewModel.cs @@ -1,13 +1,12 @@ using System.Collections.ObjectModel; using System.Windows; using CodeGraph.Algorithms.Cycles; -using CSharpCodeAnalyst.Common; -using CSharpCodeAnalyst.Messages; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; -using CSharpCodeAnalyst.Wpf; +using CSharpCodeAnalyst.Shared.Messages; +using CSharpCodeAnalyst.Shared.Wpf; -namespace CSharpCodeAnalyst.Areas.CycleGroupsArea; +namespace CSharpCodeAnalyst.Features.CycleGroups; internal class CycleGroupsViewModel : Table { @@ -81,7 +80,7 @@ public override ObservableCollection GetData() public override DataTemplate? GetRowDetailsTemplate() { var uri = new Uri( - "/CSharpCodeAnalyst;component/Areas/Shared/CodeElementLineTemplate.xaml", + "/CSharpCodeAnalyst;component/Shared/UI/CodeElementLineTemplate.xaml", UriKind.Relative); return (DataTemplate)Application.LoadComponent(uri); } diff --git a/CSharpCodeAnalyst/Areas/CycleGroupsArea/CycleLevel.cs b/CSharpCodeAnalyst/Features/CycleGroups/CycleLevel.cs similarity index 58% rename from CSharpCodeAnalyst/Areas/CycleGroupsArea/CycleLevel.cs rename to CSharpCodeAnalyst/Features/CycleGroups/CycleLevel.cs index 89977f8c..228944d8 100644 --- a/CSharpCodeAnalyst/Areas/CycleGroupsArea/CycleLevel.cs +++ b/CSharpCodeAnalyst/Features/CycleGroups/CycleLevel.cs @@ -1,4 +1,4 @@ -namespace CSharpCodeAnalyst.Areas.CycleGroupsArea; +namespace CSharpCodeAnalyst.Features.CycleGroups; public enum CycleLevel { diff --git a/CSharpCodeAnalyst/Export/Exporter.cs b/CSharpCodeAnalyst/Features/Export/Exporter.cs similarity index 98% rename from CSharpCodeAnalyst/Export/Exporter.cs rename to CSharpCodeAnalyst/Features/Export/Exporter.cs index a1d04ae2..7086ed73 100644 --- a/CSharpCodeAnalyst/Export/Exporter.cs +++ b/CSharpCodeAnalyst/Features/Export/Exporter.cs @@ -2,10 +2,10 @@ using System.IO; using System.Windows; using CodeGraph.Export; -using CSharpCodeAnalyst.Common; using CSharpCodeAnalyst.Resources; +using CSharpCodeAnalyst.Shared.Notifications; -namespace CSharpCodeAnalyst.Export; +namespace CSharpCodeAnalyst.Features.Export; /// /// Facade for various export formats. diff --git a/CSharpCodeAnalyst/Export/ImageWriter.cs b/CSharpCodeAnalyst/Features/Export/ImageWriter.cs similarity index 98% rename from CSharpCodeAnalyst/Export/ImageWriter.cs rename to CSharpCodeAnalyst/Features/Export/ImageWriter.cs index ea64c23b..5c6e234a 100644 --- a/CSharpCodeAnalyst/Export/ImageWriter.cs +++ b/CSharpCodeAnalyst/Features/Export/ImageWriter.cs @@ -2,9 +2,9 @@ using System.Windows; using System.Windows.Media; using System.Windows.Media.Imaging; -using CSharpCodeAnalyst.Wpf; +using CSharpCodeAnalyst.Shared.Wpf; -namespace CSharpCodeAnalyst.Export; +namespace CSharpCodeAnalyst.Features.Export; /// /// This class was taken from https://github.com/microsoft/automatic-graph-layout samples. diff --git a/CSharpCodeAnalyst/Gallery/Gallery.cs b/CSharpCodeAnalyst/Features/Gallery/Gallery.cs similarity index 91% rename from CSharpCodeAnalyst/Gallery/Gallery.cs rename to CSharpCodeAnalyst/Features/Gallery/Gallery.cs index f037a1aa..a1361e2d 100644 --- a/CSharpCodeAnalyst/Gallery/Gallery.cs +++ b/CSharpCodeAnalyst/Features/Gallery/Gallery.cs @@ -1,7 +1,7 @@ -using CSharpCodeAnalyst.Areas.GraphArea; -using CSharpCodeAnalyst.Messages; +using CSharpCodeAnalyst.Features.Graph; +using CSharpCodeAnalyst.Shared.Messages; -namespace CSharpCodeAnalyst.Gallery; +namespace CSharpCodeAnalyst.Features.Gallery; [Serializable] public class Gallery diff --git a/CSharpCodeAnalyst/Gallery/GalleryEditor.xaml b/CSharpCodeAnalyst/Features/Gallery/GalleryEditor.xaml similarity index 97% rename from CSharpCodeAnalyst/Gallery/GalleryEditor.xaml rename to CSharpCodeAnalyst/Features/Gallery/GalleryEditor.xaml index 0737d57c..0fcbfc1e 100644 --- a/CSharpCodeAnalyst/Gallery/GalleryEditor.xaml +++ b/CSharpCodeAnalyst/Features/Gallery/GalleryEditor.xaml @@ -1,9 +1,8 @@ - /// Interaction logic for GalleryEditor.xaml diff --git a/CSharpCodeAnalyst/Gallery/GalleryEditorViewModel.cs b/CSharpCodeAnalyst/Features/Gallery/GalleryEditorViewModel.cs similarity index 95% rename from CSharpCodeAnalyst/Gallery/GalleryEditorViewModel.cs rename to CSharpCodeAnalyst/Features/Gallery/GalleryEditorViewModel.cs index 0c6278d8..99f52654 100644 --- a/CSharpCodeAnalyst/Gallery/GalleryEditorViewModel.cs +++ b/CSharpCodeAnalyst/Features/Gallery/GalleryEditorViewModel.cs @@ -1,10 +1,10 @@ using System.Collections.ObjectModel; using System.ComponentModel; using System.Windows.Input; -using CSharpCodeAnalyst.Areas.GraphArea; -using CSharpCodeAnalyst.Wpf; +using CSharpCodeAnalyst.Features.Graph; +using CSharpCodeAnalyst.Shared.Wpf; -namespace CSharpCodeAnalyst.Gallery; +namespace CSharpCodeAnalyst.Features.Gallery; public sealed class GalleryEditorViewModel : INotifyPropertyChanged { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/ClickController.cs b/CSharpCodeAnalyst/Features/Graph/ClickController.cs similarity index 98% rename from CSharpCodeAnalyst/Areas/GraphArea/ClickController.cs rename to CSharpCodeAnalyst/Features/Graph/ClickController.cs index 2fdc2552..351a12a4 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/ClickController.cs +++ b/CSharpCodeAnalyst/Features/Graph/ClickController.cs @@ -3,7 +3,7 @@ using System.Windows.Threading; using Microsoft.Msagl.Drawing; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; internal enum States { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/CodeElementContextCommand.cs b/CSharpCodeAnalyst/Features/Graph/CodeElementContextCommand.cs similarity index 97% rename from CSharpCodeAnalyst/Areas/GraphArea/CodeElementContextCommand.cs rename to CSharpCodeAnalyst/Features/Graph/CodeElementContextCommand.cs index 273c46bc..65273a9f 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/CodeElementContextCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/CodeElementContextCommand.cs @@ -1,7 +1,7 @@ using System.Windows.Media; using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; public class CodeElementContextCommand : ICodeElementContextCommand { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/CodeExplorerControl.xaml b/CSharpCodeAnalyst/Features/Graph/CodeExplorerControl.xaml similarity index 96% rename from CSharpCodeAnalyst/Areas/GraphArea/CodeExplorerControl.xaml rename to CSharpCodeAnalyst/Features/Graph/CodeExplorerControl.xaml index bf63000d..46f46290 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/CodeExplorerControl.xaml +++ b/CSharpCodeAnalyst/Features/Graph/CodeExplorerControl.xaml @@ -1,12 +1,12 @@ - - /// Represents which CodeElement types and Relationship types should be hidden from the graph view. diff --git a/CSharpCodeAnalyst/Areas/GraphArea/GlobalCommand.cs b/CSharpCodeAnalyst/Features/Graph/GlobalCommand.cs similarity index 96% rename from CSharpCodeAnalyst/Areas/GraphArea/GlobalCommand.cs rename to CSharpCodeAnalyst/Features/Graph/GlobalCommand.cs index 863a0e1d..22108b6e 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/GlobalCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/GlobalCommand.cs @@ -2,7 +2,7 @@ using System.Windows.Media; using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; /// /// Global command to work on all selected code elements diff --git a/CSharpCodeAnalyst/Areas/GraphArea/GraphDropHandler.cs b/CSharpCodeAnalyst/Features/Graph/GraphDropHandler.cs similarity index 92% rename from CSharpCodeAnalyst/Areas/GraphArea/GraphDropHandler.cs rename to CSharpCodeAnalyst/Features/Graph/GraphDropHandler.cs index 11482b71..b1453c9f 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/GraphDropHandler.cs +++ b/CSharpCodeAnalyst/Features/Graph/GraphDropHandler.cs @@ -1,11 +1,11 @@ using System.Windows; -using CSharpCodeAnalyst.Areas.AdvancedSearchArea; -using CSharpCodeAnalyst.Areas.TreeArea; -using CSharpCodeAnalyst.Messages; +using CSharpCodeAnalyst.Features.AdvancedSearch; +using CSharpCodeAnalyst.Features.Tree; using CSharpCodeAnalyst.Shared.Contracts; +using CSharpCodeAnalyst.Shared.Messages; using GongSolutions.Wpf.DragDrop; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; /// /// Handles drag and drop operations from the TreeView to the Graph area. diff --git a/CSharpCodeAnalyst/Areas/GraphArea/GraphSearchControl.xaml b/CSharpCodeAnalyst/Features/Graph/GraphSearchControl.xaml similarity index 98% rename from CSharpCodeAnalyst/Areas/GraphArea/GraphSearchControl.xaml rename to CSharpCodeAnalyst/Features/Graph/GraphSearchControl.xaml index aeba8481..7b9e4215 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/GraphSearchControl.xaml +++ b/CSharpCodeAnalyst/Features/Graph/GraphSearchControl.xaml @@ -1,4 +1,4 @@ - /// Minimum state required to restore a graph session. diff --git a/CSharpCodeAnalyst/Areas/GraphArea/GraphViewModel.cs b/CSharpCodeAnalyst/Features/Graph/GraphViewModel.cs similarity index 98% rename from CSharpCodeAnalyst/Areas/GraphArea/GraphViewModel.cs rename to CSharpCodeAnalyst/Features/Graph/GraphViewModel.cs index 622ecbdd..1c8169ee 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/GraphViewModel.cs +++ b/CSharpCodeAnalyst/Features/Graph/GraphViewModel.cs @@ -4,19 +4,19 @@ using System.Windows; using System.Windows.Input; using CodeGraph.Graph; -using CSharpCodeAnalyst.Areas.GraphArea.Filtering; -using CSharpCodeAnalyst.Areas.GraphArea.RenderOptions; using CSharpCodeAnalyst.Configuration; using CSharpCodeAnalyst.Exploration; -using CSharpCodeAnalyst.Help; -using CSharpCodeAnalyst.Messages; -using CSharpCodeAnalyst.Refactoring; +using CSharpCodeAnalyst.Features.Graph.Filtering; +using CSharpCodeAnalyst.Features.Graph.RenderOptions; +using CSharpCodeAnalyst.Features.Help; +using CSharpCodeAnalyst.Features.Refactoring; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.Contracts; +using CSharpCodeAnalyst.Shared.Messages; using CSharpCodeAnalyst.Shared.UI; -using CSharpCodeAnalyst.Wpf; +using CSharpCodeAnalyst.Shared.Wpf; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; /// /// Defines and handles the context menu commands for the graph viewer. diff --git a/CSharpCodeAnalyst/Areas/GraphArea/GraphViewer.cs b/CSharpCodeAnalyst/Features/Graph/GraphViewer.cs similarity index 98% rename from CSharpCodeAnalyst/Areas/GraphArea/GraphViewer.cs rename to CSharpCodeAnalyst/Features/Graph/GraphViewer.cs index 078124a4..3cd35eac 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/GraphViewer.cs +++ b/CSharpCodeAnalyst/Features/Graph/GraphViewer.cs @@ -6,18 +6,18 @@ using System.Windows.Controls; using System.Windows.Input; using CodeGraph.Graph; -using CSharpCodeAnalyst.Areas.GraphArea.Filtering; -using CSharpCodeAnalyst.Areas.GraphArea.Highlighting; -using CSharpCodeAnalyst.Areas.GraphArea.RenderOptions; -using CSharpCodeAnalyst.Help; -using CSharpCodeAnalyst.Messages; +using CSharpCodeAnalyst.Features.Graph.Filtering; +using CSharpCodeAnalyst.Features.Graph.Highlighting; +using CSharpCodeAnalyst.Features.Graph.RenderOptions; +using CSharpCodeAnalyst.Features.Help; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.Contracts; +using CSharpCodeAnalyst.Shared.Messages; using Microsoft.Msagl.Core.Routing; using Microsoft.Msagl.Drawing; using Node = Microsoft.Msagl.Drawing.Node; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; /// /// Note: @@ -730,7 +730,7 @@ private bool RefreshGraph(bool askUserToShowLargeGraphs = true) var elements = graph.Nodes.Count() + graph.Edges.Count() + graph.SubgraphMap.Count; if (!ShouldProceedWithLargeGraph(elements)) { - _msaglViewer.Graph = new Graph(); + _msaglViewer.Graph = new Microsoft.Msagl.Drawing.Graph(); return false; } } diff --git a/CSharpCodeAnalyst/Areas/GraphArea/Highlighting/EdgeHoveredHighlighting.cs b/CSharpCodeAnalyst/Features/Graph/Highlighting/EdgeHoveredHighlighting.cs similarity index 90% rename from CSharpCodeAnalyst/Areas/GraphArea/Highlighting/EdgeHoveredHighlighting.cs rename to CSharpCodeAnalyst/Features/Graph/Highlighting/EdgeHoveredHighlighting.cs index 94fff63f..e3af5364 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/Highlighting/EdgeHoveredHighlighting.cs +++ b/CSharpCodeAnalyst/Features/Graph/Highlighting/EdgeHoveredHighlighting.cs @@ -1,6 +1,6 @@ using Microsoft.Msagl.Drawing; -namespace CSharpCodeAnalyst.Areas.GraphArea.Highlighting; +namespace CSharpCodeAnalyst.Features.Graph.Highlighting; internal class EdgeHoveredHighlighting : HighlightingBase { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/Highlighting/HighlightShortestNonSelfCircuit.cs b/CSharpCodeAnalyst/Features/Graph/Highlighting/HighlightShortestNonSelfCircuit.cs similarity index 97% rename from CSharpCodeAnalyst/Areas/GraphArea/Highlighting/HighlightShortestNonSelfCircuit.cs rename to CSharpCodeAnalyst/Features/Graph/Highlighting/HighlightShortestNonSelfCircuit.cs index 5a015367..6b0b9994 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/Highlighting/HighlightShortestNonSelfCircuit.cs +++ b/CSharpCodeAnalyst/Features/Graph/Highlighting/HighlightShortestNonSelfCircuit.cs @@ -1,11 +1,11 @@ using Microsoft.Msagl.Drawing; -namespace CSharpCodeAnalyst.Areas.GraphArea.Highlighting; +namespace CSharpCodeAnalyst.Features.Graph.Highlighting; internal class HighlightShortestNonSelfCircuit : HighlightingBase { private Dictionary _idToViewerNode = new(); - private Graph? _lastGraph; + private Microsoft.Msagl.Drawing.Graph? _lastGraph; private void Clear(IGraphViewerHighlighting graphViewer) diff --git a/CSharpCodeAnalyst/Areas/GraphArea/Highlighting/HighlightingBase.cs b/CSharpCodeAnalyst/Features/Graph/Highlighting/HighlightingBase.cs similarity index 80% rename from CSharpCodeAnalyst/Areas/GraphArea/Highlighting/HighlightingBase.cs rename to CSharpCodeAnalyst/Features/Graph/Highlighting/HighlightingBase.cs index c1b4cf8b..474cfaf2 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/Highlighting/HighlightingBase.cs +++ b/CSharpCodeAnalyst/Features/Graph/Highlighting/HighlightingBase.cs @@ -1,6 +1,6 @@ using Microsoft.Msagl.Drawing; -namespace CSharpCodeAnalyst.Areas.GraphArea.Highlighting; +namespace CSharpCodeAnalyst.Features.Graph.Highlighting; internal abstract class HighlightingBase : IHighlighting { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/Highlighting/IHighlighting.cs b/CSharpCodeAnalyst/Features/Graph/Highlighting/IHighlighting.cs similarity index 77% rename from CSharpCodeAnalyst/Areas/GraphArea/Highlighting/IHighlighting.cs rename to CSharpCodeAnalyst/Features/Graph/Highlighting/IHighlighting.cs index 3923c337..980f7ff1 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/Highlighting/IHighlighting.cs +++ b/CSharpCodeAnalyst/Features/Graph/Highlighting/IHighlighting.cs @@ -1,6 +1,6 @@ using Microsoft.Msagl.Drawing; -namespace CSharpCodeAnalyst.Areas.GraphArea.Highlighting; +namespace CSharpCodeAnalyst.Features.Graph.Highlighting; internal interface IHighlighting { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/Highlighting/OutgoingEdgesOfChildrenAndSelfHighlighting.cs b/CSharpCodeAnalyst/Features/Graph/Highlighting/OutgoingEdgesOfChildrenAndSelfHighlighting.cs similarity index 94% rename from CSharpCodeAnalyst/Areas/GraphArea/Highlighting/OutgoingEdgesOfChildrenAndSelfHighlighting.cs rename to CSharpCodeAnalyst/Features/Graph/Highlighting/OutgoingEdgesOfChildrenAndSelfHighlighting.cs index ae92514e..91898e33 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/Highlighting/OutgoingEdgesOfChildrenAndSelfHighlighting.cs +++ b/CSharpCodeAnalyst/Features/Graph/Highlighting/OutgoingEdgesOfChildrenAndSelfHighlighting.cs @@ -1,6 +1,6 @@ using Microsoft.Msagl.Drawing; -namespace CSharpCodeAnalyst.Areas.GraphArea.Highlighting; +namespace CSharpCodeAnalyst.Features.Graph.Highlighting; internal class OutgoingEdgesOfChildrenAndSelfHighlighting : HighlightingBase { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/ICodeElementContextCommand.cs b/CSharpCodeAnalyst/Features/Graph/ICodeElementContextCommand.cs similarity index 87% rename from CSharpCodeAnalyst/Areas/GraphArea/ICodeElementContextCommand.cs rename to CSharpCodeAnalyst/Features/Graph/ICodeElementContextCommand.cs index fc285d86..d0a6dca6 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/ICodeElementContextCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/ICodeElementContextCommand.cs @@ -1,7 +1,7 @@ using System.Windows.Media; using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; public interface ICodeElementContextCommand { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/IGlobalCommand.cs b/CSharpCodeAnalyst/Features/Graph/IGlobalCommand.cs similarity index 87% rename from CSharpCodeAnalyst/Areas/GraphArea/IGlobalCommand.cs rename to CSharpCodeAnalyst/Features/Graph/IGlobalCommand.cs index 19f83115..16798bec 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/IGlobalCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/IGlobalCommand.cs @@ -2,7 +2,7 @@ using System.Windows.Media; using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; public interface IGlobalCommand { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/IGraphBinding.cs b/CSharpCodeAnalyst/Features/Graph/IGraphBinding.cs similarity index 86% rename from CSharpCodeAnalyst/Areas/GraphArea/IGraphBinding.cs rename to CSharpCodeAnalyst/Features/Graph/IGraphBinding.cs index a0804619..cf3467b8 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/IGraphBinding.cs +++ b/CSharpCodeAnalyst/Features/Graph/IGraphBinding.cs @@ -1,6 +1,6 @@ using System.Windows.Controls; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; public interface IGraphBinding { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/IGraphViewer.cs b/CSharpCodeAnalyst/Features/Graph/IGraphViewer.cs similarity index 94% rename from CSharpCodeAnalyst/Areas/GraphArea/IGraphViewer.cs rename to CSharpCodeAnalyst/Features/Graph/IGraphViewer.cs index 4e810ee7..f41d838c 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/IGraphViewer.cs +++ b/CSharpCodeAnalyst/Features/Graph/IGraphViewer.cs @@ -1,11 +1,11 @@ using System.IO; using System.Windows.Input; using CodeGraph.Graph; -using CSharpCodeAnalyst.Areas.GraphArea.Filtering; -using CSharpCodeAnalyst.Areas.GraphArea.RenderOptions; -using CSharpCodeAnalyst.Help; +using CSharpCodeAnalyst.Features.Graph.Filtering; +using CSharpCodeAnalyst.Features.Graph.RenderOptions; +using CSharpCodeAnalyst.Features.Help; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; public interface IGraphViewer { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/IGraphViewerHighlighting.cs b/CSharpCodeAnalyst/Features/Graph/IGraphViewerHighlighting.cs similarity index 91% rename from CSharpCodeAnalyst/Areas/GraphArea/IGraphViewerHighlighting.cs rename to CSharpCodeAnalyst/Features/Graph/IGraphViewerHighlighting.cs index a9814bde..beae5e12 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/IGraphViewerHighlighting.cs +++ b/CSharpCodeAnalyst/Features/Graph/IGraphViewerHighlighting.cs @@ -1,6 +1,6 @@ using Microsoft.Msagl.Drawing; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; public interface IGraphViewerHighlighting { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/IRelationshipContextCommand.cs b/CSharpCodeAnalyst/Features/Graph/IRelationshipContextCommand.cs similarity index 88% rename from CSharpCodeAnalyst/Areas/GraphArea/IRelationshipContextCommand.cs rename to CSharpCodeAnalyst/Features/Graph/IRelationshipContextCommand.cs index f7576fc7..8a4982da 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/IRelationshipContextCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/IRelationshipContextCommand.cs @@ -1,7 +1,7 @@ using System.Windows.Media; using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; public interface IRelationshipContextCommand { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/MsaglBuilderBase.cs b/CSharpCodeAnalyst/Features/Graph/MsaglBuilderBase.cs similarity index 92% rename from CSharpCodeAnalyst/Areas/GraphArea/MsaglBuilderBase.cs rename to CSharpCodeAnalyst/Features/Graph/MsaglBuilderBase.cs index ee5fd5bc..cdbc0905 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/MsaglBuilderBase.cs +++ b/CSharpCodeAnalyst/Features/Graph/MsaglBuilderBase.cs @@ -1,9 +1,9 @@ using CodeGraph.Colors; using CodeGraph.Graph; -using CSharpCodeAnalyst.Areas.GraphArea.Filtering; +using CSharpCodeAnalyst.Features.Graph.Filtering; using Microsoft.Msagl.Drawing; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; internal abstract class MsaglBuilderBase { @@ -24,7 +24,7 @@ internal abstract class MsaglBuilderBase { RelationshipType.UsesAttribute, false } // Decorated -> Attribute (metadata flow) }; - public abstract Graph CreateGraph(CodeGraph.Graph.CodeGraph codeGraph, PresentationState presentationState, + public abstract Microsoft.Msagl.Drawing.Graph CreateGraph(CodeGraph.Graph.CodeGraph codeGraph, PresentationState presentationState, bool showInformationFlow, GraphHideFilter hideFilter); protected static NodeAttr CreateNodeAttr(CodeElement element, PresentationState presentationState) @@ -100,7 +100,7 @@ private static Color ToColor(int colorValue) return new Color((byte)r, (byte)g, (byte)b); } - protected virtual Node CreateNode(Graph graph, CodeElement codeElement, PresentationState presentationState) + protected virtual Node CreateNode(Microsoft.Msagl.Drawing.Graph graph, CodeElement codeElement, PresentationState presentationState) { var node = graph.AddNode(codeElement.Id); node.LabelText = codeElement.Name; diff --git a/CSharpCodeAnalyst/Areas/GraphArea/MsaglFlatBuilder.cs b/CSharpCodeAnalyst/Features/Graph/MsaglFlatBuilder.cs similarity index 79% rename from CSharpCodeAnalyst/Areas/GraphArea/MsaglFlatBuilder.cs rename to CSharpCodeAnalyst/Features/Graph/MsaglFlatBuilder.cs index 2004eabf..66d2189e 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/MsaglFlatBuilder.cs +++ b/CSharpCodeAnalyst/Features/Graph/MsaglFlatBuilder.cs @@ -1,22 +1,22 @@ using CodeGraph.Graph; -using CSharpCodeAnalyst.Areas.GraphArea.Filtering; +using CSharpCodeAnalyst.Features.Graph.Filtering; using Microsoft.Msagl.Drawing; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; internal class MsaglFlatBuilder : MsaglBuilderBase { - public override Graph CreateGraph(CodeGraph.Graph.CodeGraph codeGraph, PresentationState presentationState, + public override Microsoft.Msagl.Drawing.Graph CreateGraph(CodeGraph.Graph.CodeGraph codeGraph, PresentationState presentationState, bool showInformationFlow, GraphHideFilter hideFilter) { return CreateFlatGraph(codeGraph, presentationState, showInformationFlow, hideFilter); } - private Graph CreateFlatGraph(CodeGraph.Graph.CodeGraph codeGraph, PresentationState presentationState, bool showInformationFlow, GraphHideFilter hideFilter) + private Microsoft.Msagl.Drawing.Graph CreateFlatGraph(CodeGraph.Graph.CodeGraph codeGraph, PresentationState presentationState, bool showInformationFlow, GraphHideFilter hideFilter) { // Since we start with a fresh graph we don't need to check for existing nodes and edges. - var graph = new Graph("graph"); + var graph = new Microsoft.Msagl.Drawing.Graph("graph"); // Add nodes (excluding hidden ones) foreach (var codeElement in codeGraph.Nodes.Values) @@ -69,7 +69,7 @@ void AddRelationshipsFunc(CodeElement element) } } - private static void CreateContainmentEdge(Graph graph, Relationship relationship) + private static void CreateContainmentEdge(Microsoft.Msagl.Drawing.Graph graph, Relationship relationship) { var edge = graph.AddEdge(relationship.SourceId, relationship.TargetId); edge.LabelText = ""; @@ -78,7 +78,7 @@ private static void CreateContainmentEdge(Graph graph, Relationship relationship edge.UserData = relationship; } - private static void CreateEdgeForFlatStructure(Graph graph, Relationship relationship, bool reverseEdge, PresentationState state) + private static void CreateEdgeForFlatStructure(Microsoft.Msagl.Drawing.Graph graph, Relationship relationship, bool reverseEdge, PresentationState state) { // MSAGL does not allow two same edges with different labels to the same subgraph. diff --git a/CSharpCodeAnalyst/Areas/GraphArea/MsaglHierarchicalBuilder.cs b/CSharpCodeAnalyst/Features/Graph/MsaglHierarchicalBuilder.cs similarity index 87% rename from CSharpCodeAnalyst/Areas/GraphArea/MsaglHierarchicalBuilder.cs rename to CSharpCodeAnalyst/Features/Graph/MsaglHierarchicalBuilder.cs index 3b93c337..38bc5f76 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/MsaglHierarchicalBuilder.cs +++ b/CSharpCodeAnalyst/Features/Graph/MsaglHierarchicalBuilder.cs @@ -1,8 +1,8 @@ using CodeGraph.Graph; -using CSharpCodeAnalyst.Areas.GraphArea.Filtering; +using CSharpCodeAnalyst.Features.Graph.Filtering; using Microsoft.Msagl.Drawing; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; /// /// Transformation of a CodGraph to Msagl graph structure. @@ -11,16 +11,16 @@ namespace CSharpCodeAnalyst.Areas.GraphArea; /// internal class MsaglHierarchicalBuilder : MsaglBuilderBase { - public override Graph CreateGraph(CodeGraph.Graph.CodeGraph codeGraph, PresentationState presentationState, + public override Microsoft.Msagl.Drawing.Graph CreateGraph(CodeGraph.Graph.CodeGraph codeGraph, PresentationState presentationState, bool showInformationFlow, GraphHideFilter hideFilter) { return CreateHierarchicalGraph(codeGraph, presentationState, showInformationFlow, hideFilter); } - private Graph CreateHierarchicalGraph(CodeGraph.Graph.CodeGraph codeGraph, PresentationState presentationState, bool showInformationFlow, GraphHideFilter hideFilter) + private Microsoft.Msagl.Drawing.Graph CreateHierarchicalGraph(CodeGraph.Graph.CodeGraph codeGraph, PresentationState presentationState, bool showInformationFlow, GraphHideFilter hideFilter) { var visibleGraph = GetVisibleGraph(codeGraph, presentationState, hideFilter); - var graph = new Graph("graph"); + var graph = new Microsoft.Msagl.Drawing.Graph("graph"); var subGraphs = CreateSubGraphs(codeGraph, visibleGraph, presentationState); AddNodesToHierarchicalGraph(graph, visibleGraph, codeGraph, subGraphs, presentationState); @@ -64,7 +64,7 @@ private static void CollectVisibleNodes(CodeElement root, PresentationState stat } } - protected override Node CreateNode(Graph graph, CodeElement codeElement, PresentationState presentationState) + protected override Node CreateNode(Microsoft.Msagl.Drawing.Graph graph, CodeElement codeElement, PresentationState presentationState) { var node = base.CreateNode(graph, codeElement, presentationState); @@ -77,7 +77,7 @@ protected override Node CreateNode(Graph graph, CodeElement codeElement, Present return node; } - private void AddNodesToHierarchicalGraph(Graph graph, CodeGraph.Graph.CodeGraph visibleGraph, CodeGraph.Graph.CodeGraph codeGraph, + private void AddNodesToHierarchicalGraph(Microsoft.Msagl.Drawing.Graph graph, CodeGraph.Graph.CodeGraph visibleGraph, CodeGraph.Graph.CodeGraph codeGraph, Dictionary subGraphs, PresentationState presentationState) { // Add nodes and sub graphs. Each node that has children becomes a subgraph. @@ -99,7 +99,7 @@ private void AddNodesToHierarchicalGraph(Graph graph, CodeGraph.Graph.CodeGraph } } - private static void AddSubgraphToParent(Graph graph, CodeElement visibleNode, Subgraph subGraph, + private static void AddSubgraphToParent(Microsoft.Msagl.Drawing.Graph graph, CodeElement visibleNode, Subgraph subGraph, Dictionary subGraphs) { if (visibleNode.Parent == null) @@ -112,7 +112,7 @@ private static void AddSubgraphToParent(Graph graph, CodeElement visibleNode, Su } } - private void AddNodeToParent(Graph graph, CodeElement node, Dictionary subGraphs, PresentationState presentationState) + private void AddNodeToParent(Microsoft.Msagl.Drawing.Graph graph, CodeElement node, Dictionary subGraphs, PresentationState presentationState) { var newNode = CreateNode(graph, node, presentationState); if (node.Parent != null) @@ -121,7 +121,7 @@ private void AddNodeToParent(Graph graph, CodeElement node, Dictionary> mappedRelationships, PresentationState state) { // MSAGL does not allow two same edges with different labels to the same subgraph. diff --git a/CSharpCodeAnalyst/Areas/GraphArea/PresentationState.cs b/CSharpCodeAnalyst/Features/Graph/PresentationState.cs similarity index 98% rename from CSharpCodeAnalyst/Areas/GraphArea/PresentationState.cs rename to CSharpCodeAnalyst/Features/Graph/PresentationState.cs index 90beb9a7..34a2d0de 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/PresentationState.cs +++ b/CSharpCodeAnalyst/Features/Graph/PresentationState.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; public class PresentationState { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/RelationshipContextCommand.cs b/CSharpCodeAnalyst/Features/Graph/RelationshipContextCommand.cs similarity index 98% rename from CSharpCodeAnalyst/Areas/GraphArea/RelationshipContextCommand.cs rename to CSharpCodeAnalyst/Features/Graph/RelationshipContextCommand.cs index 18162d38..050aef85 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/RelationshipContextCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/RelationshipContextCommand.cs @@ -1,7 +1,7 @@ using System.Windows.Media; using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; public class RelationshipContextCommand : IRelationshipContextCommand { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/BottomToTopRenderOptions.cs b/CSharpCodeAnalyst/Features/Graph/RenderOptions/BottomToTopRenderOptions.cs similarity index 69% rename from CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/BottomToTopRenderOptions.cs rename to CSharpCodeAnalyst/Features/Graph/RenderOptions/BottomToTopRenderOptions.cs index 5843e8b4..814177b7 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/BottomToTopRenderOptions.cs +++ b/CSharpCodeAnalyst/Features/Graph/RenderOptions/BottomToTopRenderOptions.cs @@ -1,7 +1,7 @@ using CSharpCodeAnalyst.Resources; using Microsoft.Msagl.Drawing; -namespace CSharpCodeAnalyst.Areas.GraphArea.RenderOptions; +namespace CSharpCodeAnalyst.Features.Graph.RenderOptions; internal class BottomToTopRenderOptions : RenderOption { @@ -10,7 +10,7 @@ public BottomToTopRenderOptions() Name = Strings.Bottom_To_Top_Label; } - public override void Apply(Graph graph) + public override void Apply(Microsoft.Msagl.Drawing.Graph graph) { graph.Attr.LayerDirection = LayerDirection.BT; } diff --git a/CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/DefaultRenderOptions.cs b/CSharpCodeAnalyst/Features/Graph/RenderOptions/DefaultRenderOptions.cs similarity index 68% rename from CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/DefaultRenderOptions.cs rename to CSharpCodeAnalyst/Features/Graph/RenderOptions/DefaultRenderOptions.cs index a4d8dc78..40c56abb 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/DefaultRenderOptions.cs +++ b/CSharpCodeAnalyst/Features/Graph/RenderOptions/DefaultRenderOptions.cs @@ -1,7 +1,7 @@ using CSharpCodeAnalyst.Resources; using Microsoft.Msagl.Drawing; -namespace CSharpCodeAnalyst.Areas.GraphArea.RenderOptions; +namespace CSharpCodeAnalyst.Features.Graph.RenderOptions; public class DefaultRenderOptions : RenderOption { @@ -10,7 +10,7 @@ public DefaultRenderOptions() Name = Strings.Default_Label; } - public override void Apply(Graph graph) + public override void Apply(Microsoft.Msagl.Drawing.Graph graph) { graph.Attr.LayerDirection = LayerDirection.TB; } diff --git a/CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/HighlightMode.cs b/CSharpCodeAnalyst/Features/Graph/RenderOptions/HighlightMode.cs similarity index 63% rename from CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/HighlightMode.cs rename to CSharpCodeAnalyst/Features/Graph/RenderOptions/HighlightMode.cs index a76b34d8..7cc444a7 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/HighlightMode.cs +++ b/CSharpCodeAnalyst/Features/Graph/RenderOptions/HighlightMode.cs @@ -1,4 +1,4 @@ -namespace CSharpCodeAnalyst.Areas.GraphArea.RenderOptions; +namespace CSharpCodeAnalyst.Features.Graph.RenderOptions; public enum HighlightMode { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/HighlightOption.cs b/CSharpCodeAnalyst/Features/Graph/RenderOptions/HighlightOption.cs similarity index 85% rename from CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/HighlightOption.cs rename to CSharpCodeAnalyst/Features/Graph/RenderOptions/HighlightOption.cs index 80487c8d..e3850172 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/HighlightOption.cs +++ b/CSharpCodeAnalyst/Features/Graph/RenderOptions/HighlightOption.cs @@ -1,6 +1,6 @@ using CSharpCodeAnalyst.Resources; -namespace CSharpCodeAnalyst.Areas.GraphArea.RenderOptions; +namespace CSharpCodeAnalyst.Features.Graph.RenderOptions; public class HighlightOption(HighlightMode mode, string label) { diff --git a/CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/LeftToRightRenderOptions.cs b/CSharpCodeAnalyst/Features/Graph/RenderOptions/LeftToRightRenderOptions.cs similarity index 71% rename from CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/LeftToRightRenderOptions.cs rename to CSharpCodeAnalyst/Features/Graph/RenderOptions/LeftToRightRenderOptions.cs index cb7b2b02..e8390c87 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/LeftToRightRenderOptions.cs +++ b/CSharpCodeAnalyst/Features/Graph/RenderOptions/LeftToRightRenderOptions.cs @@ -1,7 +1,7 @@ using CSharpCodeAnalyst.Resources; using Microsoft.Msagl.Drawing; -namespace CSharpCodeAnalyst.Areas.GraphArea.RenderOptions; +namespace CSharpCodeAnalyst.Features.Graph.RenderOptions; public class LeftToRightRenderOptions : RenderOption { @@ -10,7 +10,7 @@ public LeftToRightRenderOptions() Name = Strings.Left_To_Right_Label; } - public override void Apply(Graph graph) + public override void Apply(Microsoft.Msagl.Drawing.Graph graph) { // Do nothing graph.Attr.LayerDirection = LayerDirection.LR; diff --git a/CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/RenderOption.cs b/CSharpCodeAnalyst/Features/Graph/RenderOptions/RenderOption.cs similarity index 54% rename from CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/RenderOption.cs rename to CSharpCodeAnalyst/Features/Graph/RenderOptions/RenderOption.cs index 53414d26..3c424645 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/RenderOptions/RenderOption.cs +++ b/CSharpCodeAnalyst/Features/Graph/RenderOptions/RenderOption.cs @@ -1,6 +1,4 @@ -using Microsoft.Msagl.Drawing; - -namespace CSharpCodeAnalyst.Areas.GraphArea.RenderOptions; +namespace CSharpCodeAnalyst.Features.Graph.RenderOptions; public abstract class RenderOption { @@ -11,5 +9,5 @@ public override string ToString() return Name; } - public abstract void Apply(Graph graph); + public abstract void Apply(Microsoft.Msagl.Drawing.Graph graph); } \ No newline at end of file diff --git a/CSharpCodeAnalyst/Areas/GraphArea/SeparatorCommand.cs b/CSharpCodeAnalyst/Features/Graph/SeparatorCommand.cs similarity index 91% rename from CSharpCodeAnalyst/Areas/GraphArea/SeparatorCommand.cs rename to CSharpCodeAnalyst/Features/Graph/SeparatorCommand.cs index 2a21c0a9..2b797659 100644 --- a/CSharpCodeAnalyst/Areas/GraphArea/SeparatorCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/SeparatorCommand.cs @@ -1,7 +1,7 @@ using System.Windows.Media; using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Areas.GraphArea; +namespace CSharpCodeAnalyst.Features.Graph; public class SeparatorCommand : ICodeElementContextCommand { diff --git a/CSharpCodeAnalyst/Help/LegendDialog.xaml b/CSharpCodeAnalyst/Features/Help/LegendDialog.xaml similarity index 98% rename from CSharpCodeAnalyst/Help/LegendDialog.xaml rename to CSharpCodeAnalyst/Features/Help/LegendDialog.xaml index 606b667c..acf1217a 100644 --- a/CSharpCodeAnalyst/Help/LegendDialog.xaml +++ b/CSharpCodeAnalyst/Features/Help/LegendDialog.xaml @@ -1,4 +1,4 @@ - /// Imports various file format into a CodeGraph. diff --git a/CSharpCodeAnalyst/Import/JdepsReader.cs b/CSharpCodeAnalyst/Features/Import/JdepsReader.cs similarity index 98% rename from CSharpCodeAnalyst/Import/JdepsReader.cs rename to CSharpCodeAnalyst/Features/Import/JdepsReader.cs index f3f425d2..d9965a2c 100644 --- a/CSharpCodeAnalyst/Import/JdepsReader.cs +++ b/CSharpCodeAnalyst/Features/Import/JdepsReader.cs @@ -1,7 +1,7 @@ using System.IO; using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Import; +namespace CSharpCodeAnalyst.Features.Import; public class JdepsReader { diff --git a/CSharpCodeAnalyst/Areas/InfoArea/InfoPanel.xaml b/CSharpCodeAnalyst/Features/Info/InfoPanel.xaml similarity index 95% rename from CSharpCodeAnalyst/Areas/InfoArea/InfoPanel.xaml rename to CSharpCodeAnalyst/Features/Info/InfoPanel.xaml index 34ab2564..9951cf5a 100644 --- a/CSharpCodeAnalyst/Areas/InfoArea/InfoPanel.xaml +++ b/CSharpCodeAnalyst/Features/Info/InfoPanel.xaml @@ -1,10 +1,9 @@ - diff --git a/CSharpCodeAnalyst/Areas/InfoArea/InfoPanel.xaml.cs b/CSharpCodeAnalyst/Features/Info/InfoPanel.xaml.cs similarity index 91% rename from CSharpCodeAnalyst/Areas/InfoArea/InfoPanel.xaml.cs rename to CSharpCodeAnalyst/Features/Info/InfoPanel.xaml.cs index 1891244d..48694d05 100644 --- a/CSharpCodeAnalyst/Areas/InfoArea/InfoPanel.xaml.cs +++ b/CSharpCodeAnalyst/Features/Info/InfoPanel.xaml.cs @@ -1,6 +1,6 @@ using System.Windows; -namespace CSharpCodeAnalyst.Areas.InfoArea; +namespace CSharpCodeAnalyst.Features.Info; /// /// Interaction logic for InfoPanel.xaml diff --git a/CSharpCodeAnalyst/Areas/InfoArea/InfoPanelViewModel.cs b/CSharpCodeAnalyst/Features/Info/InfoPanelViewModel.cs similarity index 92% rename from CSharpCodeAnalyst/Areas/InfoArea/InfoPanelViewModel.cs rename to CSharpCodeAnalyst/Features/Info/InfoPanelViewModel.cs index a2eb45bb..6fb0d5ae 100644 --- a/CSharpCodeAnalyst/Areas/InfoArea/InfoPanelViewModel.cs +++ b/CSharpCodeAnalyst/Features/Info/InfoPanelViewModel.cs @@ -3,13 +3,14 @@ using System.Windows; using System.Windows.Input; using CodeGraph.Graph; -using CSharpCodeAnalyst.Help; -using CSharpCodeAnalyst.Messages; +using CSharpCodeAnalyst.Features.Help; using CSharpCodeAnalyst.Resources; +using CSharpCodeAnalyst.Shared; +using CSharpCodeAnalyst.Shared.Messages; using CSharpCodeAnalyst.Shared.Services; -using CSharpCodeAnalyst.Wpf; +using CSharpCodeAnalyst.Shared.Wpf; -namespace CSharpCodeAnalyst.Areas.InfoArea; +namespace CSharpCodeAnalyst.Features.Info; internal sealed class InfoPanelViewModel : INotifyPropertyChanged { diff --git a/CSharpCodeAnalyst/Areas/MetricArea/MetricOutput.cs b/CSharpCodeAnalyst/Features/Metrics/MetricOutput.cs similarity index 88% rename from CSharpCodeAnalyst/Areas/MetricArea/MetricOutput.cs rename to CSharpCodeAnalyst/Features/Metrics/MetricOutput.cs index cbc448c4..0a07aa1f 100644 --- a/CSharpCodeAnalyst/Areas/MetricArea/MetricOutput.cs +++ b/CSharpCodeAnalyst/Features/Metrics/MetricOutput.cs @@ -1,7 +1,7 @@ using CSharpCodeAnalyst.Shared.Contracts; using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.Attributes; -namespace CSharpCodeAnalyst.Areas.MetricArea; +namespace CSharpCodeAnalyst.Features.Metrics; internal class MetricOutput(string metric, string value) : IMetric { diff --git a/CSharpCodeAnalyst/Areas/PartitionsArea/PartitionViewModel.cs b/CSharpCodeAnalyst/Features/Partitions/PartitionViewModel.cs similarity index 91% rename from CSharpCodeAnalyst/Areas/PartitionsArea/PartitionViewModel.cs rename to CSharpCodeAnalyst/Features/Partitions/PartitionViewModel.cs index a1817b85..6b7ca1d4 100644 --- a/CSharpCodeAnalyst/Areas/PartitionsArea/PartitionViewModel.cs +++ b/CSharpCodeAnalyst/Features/Partitions/PartitionViewModel.cs @@ -1,9 +1,9 @@ using System.Collections.ObjectModel; -using CSharpCodeAnalyst.Areas.Shared; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.Shared.UI; -namespace CSharpCodeAnalyst.Areas.PartitionsArea; +namespace CSharpCodeAnalyst.Features.Partitions; public class PartitionViewModel : TableRow { diff --git a/CSharpCodeAnalyst/Areas/PartitionsArea/PartitionsViewModel.cs b/CSharpCodeAnalyst/Features/Partitions/PartitionsViewModel.cs similarity index 88% rename from CSharpCodeAnalyst/Areas/PartitionsArea/PartitionsViewModel.cs rename to CSharpCodeAnalyst/Features/Partitions/PartitionsViewModel.cs index b2971ea3..5423703e 100644 --- a/CSharpCodeAnalyst/Areas/PartitionsArea/PartitionsViewModel.cs +++ b/CSharpCodeAnalyst/Features/Partitions/PartitionsViewModel.cs @@ -3,7 +3,7 @@ using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; -namespace CSharpCodeAnalyst.Areas.PartitionsArea; +namespace CSharpCodeAnalyst.Features.Partitions; public class PartitionsViewModel : Table { @@ -36,7 +36,7 @@ public override ObservableCollection GetData() public override DataTemplate? GetRowDetailsTemplate() { var uri = new Uri( - "/CSharpCodeAnalyst;component/Areas/Shared/CodeElementLineTemplate.xaml", + "/CSharpCodeAnalyst;component/Shared/UI/CodeElementLineTemplate.xaml", UriKind.Relative); return (DataTemplate)Application.LoadComponent(uri); } diff --git a/CSharpCodeAnalyst/Project/Project.cs b/CSharpCodeAnalyst/Features/Project/Project.cs similarity index 96% rename from CSharpCodeAnalyst/Project/Project.cs rename to CSharpCodeAnalyst/Features/Project/Project.cs index c0067590..98d8ecf2 100644 --- a/CSharpCodeAnalyst/Project/Project.cs +++ b/CSharpCodeAnalyst/Features/Project/Project.cs @@ -1,11 +1,12 @@ using System.IO; using System.Text.Json; using System.Text.Json.Serialization; -using CSharpCodeAnalyst.Common; -using CSharpCodeAnalyst.Import; +using CSharpCodeAnalyst.Features.Import; using CSharpCodeAnalyst.Resources; +using CSharpCodeAnalyst.Shared; +using CSharpCodeAnalyst.Shared.Notifications; -namespace CSharpCodeAnalyst.Project; +namespace CSharpCodeAnalyst.Features.Project; /// /// Loading and saving project data. diff --git a/CSharpCodeAnalyst/Project/ProjectData.cs b/CSharpCodeAnalyst/Features/Project/ProjectData.cs similarity index 98% rename from CSharpCodeAnalyst/Project/ProjectData.cs rename to CSharpCodeAnalyst/Features/Project/ProjectData.cs index 662589f6..4e594444 100644 --- a/CSharpCodeAnalyst/Project/ProjectData.cs +++ b/CSharpCodeAnalyst/Features/Project/ProjectData.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Project; +namespace CSharpCodeAnalyst.Features.Project; [Serializable] public class ProjectData diff --git a/CSharpCodeAnalyst/Project/SerializableChild.cs b/CSharpCodeAnalyst/Features/Project/SerializableChild.cs similarity index 79% rename from CSharpCodeAnalyst/Project/SerializableChild.cs rename to CSharpCodeAnalyst/Features/Project/SerializableChild.cs index 4880d74a..d2944e88 100644 --- a/CSharpCodeAnalyst/Project/SerializableChild.cs +++ b/CSharpCodeAnalyst/Features/Project/SerializableChild.cs @@ -1,4 +1,4 @@ -namespace CSharpCodeAnalyst.Project; +namespace CSharpCodeAnalyst.Features.Project; [Serializable] public class SerializableChild(string childId, string parentId) diff --git a/CSharpCodeAnalyst/Project/SerializableCodeElement.cs b/CSharpCodeAnalyst/Features/Project/SerializableCodeElement.cs similarity index 92% rename from CSharpCodeAnalyst/Project/SerializableCodeElement.cs rename to CSharpCodeAnalyst/Features/Project/SerializableCodeElement.cs index 8f79db8e..13a3ea41 100644 --- a/CSharpCodeAnalyst/Project/SerializableCodeElement.cs +++ b/CSharpCodeAnalyst/Features/Project/SerializableCodeElement.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Project; +namespace CSharpCodeAnalyst.Features.Project; [Serializable] public class SerializableCodeElement( diff --git a/CSharpCodeAnalyst/Project/SerializableRelationship.cs b/CSharpCodeAnalyst/Features/Project/SerializableRelationship.cs similarity index 91% rename from CSharpCodeAnalyst/Project/SerializableRelationship.cs rename to CSharpCodeAnalyst/Features/Project/SerializableRelationship.cs index 9fce070e..50eeb268 100644 --- a/CSharpCodeAnalyst/Project/SerializableRelationship.cs +++ b/CSharpCodeAnalyst/Features/Project/SerializableRelationship.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Project; +namespace CSharpCodeAnalyst.Features.Project; [Serializable] public class SerializableRelationship( diff --git a/CSharpCodeAnalyst/Refactoring/CodeElementNaming.cs b/CSharpCodeAnalyst/Features/Refactoring/CodeElementNaming.cs similarity index 97% rename from CSharpCodeAnalyst/Refactoring/CodeElementNaming.cs rename to CSharpCodeAnalyst/Features/Refactoring/CodeElementNaming.cs index 64d576e9..531b5258 100644 --- a/CSharpCodeAnalyst/Refactoring/CodeElementNaming.cs +++ b/CSharpCodeAnalyst/Features/Refactoring/CodeElementNaming.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Refactoring; +namespace CSharpCodeAnalyst.Features.Refactoring; public class CodeElementNaming(CodeGraph.Graph.CodeGraph codeGraph, CodeElement? parent) : ICodeElementNaming { diff --git a/CSharpCodeAnalyst/Refactoring/CodeElementSpecs.cs b/CSharpCodeAnalyst/Features/Refactoring/CodeElementSpecs.cs similarity index 80% rename from CSharpCodeAnalyst/Refactoring/CodeElementSpecs.cs rename to CSharpCodeAnalyst/Features/Refactoring/CodeElementSpecs.cs index 81f69863..39c707cf 100644 --- a/CSharpCodeAnalyst/Refactoring/CodeElementSpecs.cs +++ b/CSharpCodeAnalyst/Features/Refactoring/CodeElementSpecs.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Refactoring; +namespace CSharpCodeAnalyst.Features.Refactoring; public class CodeElementSpecs(CodeElementType elementType, string name) { diff --git a/CSharpCodeAnalyst/Refactoring/CreateCodeElementDialog.xaml b/CSharpCodeAnalyst/Features/Refactoring/CreateCodeElementDialog.xaml similarity index 94% rename from CSharpCodeAnalyst/Refactoring/CreateCodeElementDialog.xaml rename to CSharpCodeAnalyst/Features/Refactoring/CreateCodeElementDialog.xaml index 5026d9c4..1ee4620a 100644 --- a/CSharpCodeAnalyst/Refactoring/CreateCodeElementDialog.xaml +++ b/CSharpCodeAnalyst/Features/Refactoring/CreateCodeElementDialog.xaml @@ -1,9 +1,8 @@ - /// Service for virtual refactorings - modifying the code graph without changing source code. diff --git a/CSharpCodeAnalyst/Areas/TreeArea/TreeControl.xaml b/CSharpCodeAnalyst/Features/Tree/TreeControl.xaml similarity index 98% rename from CSharpCodeAnalyst/Areas/TreeArea/TreeControl.xaml rename to CSharpCodeAnalyst/Features/Tree/TreeControl.xaml index b931acde..57683a97 100644 --- a/CSharpCodeAnalyst/Areas/TreeArea/TreeControl.xaml +++ b/CSharpCodeAnalyst/Features/Tree/TreeControl.xaml @@ -1,9 +1,8 @@ -(_ => ClearQuickInfo()); + _gallery = new Gallery(); SearchCommand = new WpfCommand(Search); LoadSolutionCommand = new WpfCommand(OnImportSolution); ImportJdepsCommand = new WpfCommand(OnImportJdeps); @@ -845,7 +845,7 @@ private void CompleteImport(CodeGraph.Graph.CodeGraph graph) { LoadDefaultSettings(); LoadCodeGraph(graph); - _gallery = new Gallery.Gallery(); + _gallery = new Gallery(); OpenProjectFilePath = string.Empty; SetDirty(false); IsCanvasHintsVisible = false; @@ -1122,7 +1122,7 @@ private ProjectData CollectProjectData() { var projectData = new ProjectData(); projectData.SetCodeGraph(_codeGraph!); - projectData.SetGallery(_gallery ?? new Gallery.Gallery()); + projectData.SetGallery(_gallery ?? new Gallery()); projectData.Settings[nameof(GraphViewModel.ShowFlatGraph)] = _graphViewModel!.ShowFlatGraph.ToString(); projectData.Settings[nameof(GraphViewModel.ShowDataFlow)] = _graphViewModel.ShowDataFlow.ToString(); projectData.Settings[nameof(ProjectExclusionRegExCollection)] = _projectExclusionFilters.ToString(); diff --git a/CSharpCodeAnalyst/MainWindow.xaml b/CSharpCodeAnalyst/MainWindow.xaml index 0e4286c1..5be07496 100644 --- a/CSharpCodeAnalyst/MainWindow.xaml +++ b/CSharpCodeAnalyst/MainWindow.xaml @@ -7,11 +7,11 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:resources="clr-namespace:CSharpCodeAnalyst.Resources" - xmlns:graphArea="clr-namespace:CSharpCodeAnalyst.Areas.GraphArea" - xmlns:infoArea="clr-namespace:CSharpCodeAnalyst.Areas.InfoArea" xmlns:dynamicDataGrid1="clr-namespace:CSharpCodeAnalyst.Shared.DynamicDataGrid" - xmlns:treeArea="clr-namespace:CSharpCodeAnalyst.Areas.TreeArea" - xmlns:advancedSearchArea="clr-namespace:CSharpCodeAnalyst.Areas.AdvancedSearchArea" + xmlns:tree="clr-namespace:CSharpCodeAnalyst.Features.Tree" + xmlns:advancedSearch="clr-namespace:CSharpCodeAnalyst.Features.AdvancedSearch" + xmlns:info="clr-namespace:CSharpCodeAnalyst.Features.Info" + xmlns:graph="clr-namespace:CSharpCodeAnalyst.Features.Graph" x:Name="RootWindow" Icon="/Resources/lamp.ico" Closing="RootWindow_Closing" @@ -350,12 +350,10 @@ @@ -368,17 +366,17 @@ - + - + - + @@ -397,7 +395,7 @@ - + diff --git a/CSharpCodeAnalyst/MainWindow.xaml.cs b/CSharpCodeAnalyst/MainWindow.xaml.cs index 89321552..8997d035 100644 --- a/CSharpCodeAnalyst/MainWindow.xaml.cs +++ b/CSharpCodeAnalyst/MainWindow.xaml.cs @@ -5,14 +5,18 @@ using System.Windows.Controls.Ribbon; using System.Windows.Input; using System.Windows.Threading; -using CSharpCodeAnalyst.Areas.GraphArea; -using CSharpCodeAnalyst.Messages; +using CSharpCodeAnalyst.Features.Graph; +using CSharpCodeAnalyst.Shared.Contracts; +using CSharpCodeAnalyst.Shared.Messages; using CSharpCodeAnalyst.Shared.UI; namespace CSharpCodeAnalyst; public partial class MainWindow { + public const double TreeMinWidthCollapsed = 24; + public const double TreeMinWidthExpanded = 400; + public MainWindow() { InitializeComponent(); @@ -32,9 +36,9 @@ private void EnsureLeftColumnWidth() Dispatcher.BeginInvoke(new Action(() => { // Always ensure we have a fixed width to prevent jumping - if (SplitterColumn.Width.IsAuto || SplitterColumn.Width.Value < Constants.TreeMinWidthExpanded) + if (SplitterColumn.Width.IsAuto || SplitterColumn.Width.Value < TreeMinWidthExpanded) { - SplitterColumn.Width = new GridLength(Constants.TreeMinWidthExpanded); + SplitterColumn.Width = new GridLength(TreeMinWidthExpanded); } }), DispatcherPriority.Loaded); } @@ -66,7 +70,7 @@ private void GridSplitter_DragDelta(object sender, DragDeltaEventArgs e) var newWidth = SplitterColumn.ActualWidth + e.HorizontalChange; // Set a minimum width (adjust as needed) - var minWidth = expander.IsExpanded ? Constants.TreeMinWidthExpanded : Constants.TreeMinWidthCollapsed; + var minWidth = expander.IsExpanded ? TreeMinWidthExpanded : TreeMinWidthCollapsed; if (newWidth < minWidth) { @@ -93,9 +97,9 @@ private void RootWindow_Closing(object sender, CancelEventArgs e) } } - public void SetViewer(GraphViewer explorationGraphViewer) + public void SetViewer(GraphViewer explorationGraphViewer, IPublisher publisher) { - ExplorationControl.SetViewer(explorationGraphViewer); + ExplorationControl.SetViewer(explorationGraphViewer, publisher); } private void OnKeyDown(object sender, KeyEventArgs e) diff --git a/CSharpCodeAnalyst/Converters/InvertBooleanConverter.cs b/CSharpCodeAnalyst/Shared/Converters/InvertBooleanConverter.cs similarity index 92% rename from CSharpCodeAnalyst/Converters/InvertBooleanConverter.cs rename to CSharpCodeAnalyst/Shared/Converters/InvertBooleanConverter.cs index 37ef236b..35fa7c1d 100644 --- a/CSharpCodeAnalyst/Converters/InvertBooleanConverter.cs +++ b/CSharpCodeAnalyst/Shared/Converters/InvertBooleanConverter.cs @@ -1,7 +1,7 @@ using System.Globalization; using System.Windows.Data; -namespace CSharpCodeAnalyst.Converters; +namespace CSharpCodeAnalyst.Shared.Converters; public class InvertBooleanConverter : IValueConverter { diff --git a/CSharpCodeAnalyst/Converters/NumberToVisibilityConverter.cs b/CSharpCodeAnalyst/Shared/Converters/NumberToVisibilityConverter.cs similarity index 93% rename from CSharpCodeAnalyst/Converters/NumberToVisibilityConverter.cs rename to CSharpCodeAnalyst/Shared/Converters/NumberToVisibilityConverter.cs index 59244526..f0261794 100644 --- a/CSharpCodeAnalyst/Converters/NumberToVisibilityConverter.cs +++ b/CSharpCodeAnalyst/Shared/Converters/NumberToVisibilityConverter.cs @@ -2,7 +2,7 @@ using System.Windows; using System.Windows.Data; -namespace CSharpCodeAnalyst.Converters; +namespace CSharpCodeAnalyst.Shared.Converters; public class NumberToVisibilityConverter : IValueConverter { diff --git a/CSharpCodeAnalyst/Filter/FilterDialog.xaml b/CSharpCodeAnalyst/Shared/Filter/FilterDialog.xaml similarity index 94% rename from CSharpCodeAnalyst/Filter/FilterDialog.xaml rename to CSharpCodeAnalyst/Shared/Filter/FilterDialog.xaml index c5cc9978..268c480c 100644 --- a/CSharpCodeAnalyst/Filter/FilterDialog.xaml +++ b/CSharpCodeAnalyst/Shared/Filter/FilterDialog.xaml @@ -1,4 +1,4 @@ - /// Base class for all refactoring related notifications. +/// This is one of the few messages that justifies the message bus because it has many subscribers. /// public abstract class CodeGraphRefactored(CodeGraph.Graph.CodeGraph codeGraph) { diff --git a/CSharpCodeAnalyst/Messages/CycleCalculationComplete.cs b/CSharpCodeAnalyst/Shared/Messages/CycleCalculationComplete.cs similarity index 79% rename from CSharpCodeAnalyst/Messages/CycleCalculationComplete.cs rename to CSharpCodeAnalyst/Shared/Messages/CycleCalculationComplete.cs index 7b0100aa..74404038 100644 --- a/CSharpCodeAnalyst/Messages/CycleCalculationComplete.cs +++ b/CSharpCodeAnalyst/Shared/Messages/CycleCalculationComplete.cs @@ -1,6 +1,6 @@ using CodeGraph.Algorithms.Cycles; -namespace CSharpCodeAnalyst.Messages; +namespace CSharpCodeAnalyst.Shared.Messages; public class CycleCalculationComplete(List cycleGroups) { diff --git a/CSharpCodeAnalyst/Messages/LocateInTreeRequest.cs b/CSharpCodeAnalyst/Shared/Messages/LocateInTreeRequest.cs similarity index 63% rename from CSharpCodeAnalyst/Messages/LocateInTreeRequest.cs rename to CSharpCodeAnalyst/Shared/Messages/LocateInTreeRequest.cs index 8fe42fb9..8996e6b8 100644 --- a/CSharpCodeAnalyst/Messages/LocateInTreeRequest.cs +++ b/CSharpCodeAnalyst/Shared/Messages/LocateInTreeRequest.cs @@ -1,4 +1,4 @@ -namespace CSharpCodeAnalyst.Messages; +namespace CSharpCodeAnalyst.Shared.Messages; public class LocateInTreeRequest(string id) { diff --git a/CSharpCodeAnalyst/Common/MessageBus.cs b/CSharpCodeAnalyst/Shared/Messages/MessageBus.cs similarity index 97% rename from CSharpCodeAnalyst/Common/MessageBus.cs rename to CSharpCodeAnalyst/Shared/Messages/MessageBus.cs index df293357..f56b4b86 100644 --- a/CSharpCodeAnalyst/Common/MessageBus.cs +++ b/CSharpCodeAnalyst/Shared/Messages/MessageBus.cs @@ -1,6 +1,6 @@ using CSharpCodeAnalyst.Shared.Contracts; -namespace CSharpCodeAnalyst.Common; +namespace CSharpCodeAnalyst.Shared.Messages; public class MessageBus : ISubscriber, IPublisher { diff --git a/CSharpCodeAnalyst/Messages/QuickInfoUpdateRequest.cs b/CSharpCodeAnalyst/Shared/Messages/QuickInfoUpdateRequest.cs similarity index 61% rename from CSharpCodeAnalyst/Messages/QuickInfoUpdateRequest.cs rename to CSharpCodeAnalyst/Shared/Messages/QuickInfoUpdateRequest.cs index f26f4889..e322be82 100644 --- a/CSharpCodeAnalyst/Messages/QuickInfoUpdateRequest.cs +++ b/CSharpCodeAnalyst/Shared/Messages/QuickInfoUpdateRequest.cs @@ -1,6 +1,6 @@ -using CSharpCodeAnalyst.Help; +using CSharpCodeAnalyst.Shared; -namespace CSharpCodeAnalyst.Messages; +namespace CSharpCodeAnalyst.Shared.Messages; public class QuickInfoUpdateRequest(List quickInfo) { diff --git a/CSharpCodeAnalyst/Messages/ShowCycleGroupRequest.cs b/CSharpCodeAnalyst/Shared/Messages/ShowCycleGroupRequest.cs similarity index 77% rename from CSharpCodeAnalyst/Messages/ShowCycleGroupRequest.cs rename to CSharpCodeAnalyst/Shared/Messages/ShowCycleGroupRequest.cs index a6bb2076..611303ef 100644 --- a/CSharpCodeAnalyst/Messages/ShowCycleGroupRequest.cs +++ b/CSharpCodeAnalyst/Shared/Messages/ShowCycleGroupRequest.cs @@ -1,6 +1,6 @@ using CodeGraph.Algorithms.Cycles; -namespace CSharpCodeAnalyst.Messages; +namespace CSharpCodeAnalyst.Shared.Messages; public class ShowCycleGroupRequest(CycleGroup cycleGroup) { diff --git a/CSharpCodeAnalyst/Messages/ShowPartitionsRequest.cs b/CSharpCodeAnalyst/Shared/Messages/ShowPartitionsRequest.cs similarity index 88% rename from CSharpCodeAnalyst/Messages/ShowPartitionsRequest.cs rename to CSharpCodeAnalyst/Shared/Messages/ShowPartitionsRequest.cs index 6ed8bb10..8f1971ec 100644 --- a/CSharpCodeAnalyst/Messages/ShowPartitionsRequest.cs +++ b/CSharpCodeAnalyst/Shared/Messages/ShowPartitionsRequest.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Messages; +namespace CSharpCodeAnalyst.Shared.Messages; public class ShowPartitionsRequest { diff --git a/CSharpCodeAnalyst/Common/ConsoleUserNotification.cs b/CSharpCodeAnalyst/Shared/Notifications/ConsoleUserNotification.cs similarity index 94% rename from CSharpCodeAnalyst/Common/ConsoleUserNotification.cs rename to CSharpCodeAnalyst/Shared/Notifications/ConsoleUserNotification.cs index 4d35638d..5677b659 100644 --- a/CSharpCodeAnalyst/Common/ConsoleUserNotification.cs +++ b/CSharpCodeAnalyst/Shared/Notifications/ConsoleUserNotification.cs @@ -1,6 +1,6 @@ using System.Diagnostics; -namespace CSharpCodeAnalyst.Common; +namespace CSharpCodeAnalyst.Shared.Notifications; internal class ConsoleUserNotification : IUserNotification { diff --git a/CSharpCodeAnalyst/Common/ErrorWarningDialog.xaml b/CSharpCodeAnalyst/Shared/Notifications/ErrorWarningDialog.xaml similarity index 97% rename from CSharpCodeAnalyst/Common/ErrorWarningDialog.xaml rename to CSharpCodeAnalyst/Shared/Notifications/ErrorWarningDialog.xaml index 00a64a39..5219819b 100644 --- a/CSharpCodeAnalyst/Common/ErrorWarningDialog.xaml +++ b/CSharpCodeAnalyst/Shared/Notifications/ErrorWarningDialog.xaml @@ -1,4 +1,4 @@ - /// Without data diff --git a/CSharpCodeAnalyst/Common/PascalCaseSearch.cs b/CSharpCodeAnalyst/Shared/Search/PascalCaseSearch.cs similarity index 97% rename from CSharpCodeAnalyst/Common/PascalCaseSearch.cs rename to CSharpCodeAnalyst/Shared/Search/PascalCaseSearch.cs index 7b911811..e1309626 100644 --- a/CSharpCodeAnalyst/Common/PascalCaseSearch.cs +++ b/CSharpCodeAnalyst/Shared/Search/PascalCaseSearch.cs @@ -1,7 +1,7 @@ using System.Text; using System.Text.RegularExpressions; -namespace CSharpCodeAnalyst.Common; +namespace CSharpCodeAnalyst.Shared.Search; public static class PascalCaseSearch { diff --git a/CSharpCodeAnalyst/Common/SearchExpression.cs b/CSharpCodeAnalyst/Shared/Search/SearchExpression.cs similarity index 99% rename from CSharpCodeAnalyst/Common/SearchExpression.cs rename to CSharpCodeAnalyst/Shared/Search/SearchExpression.cs index 961a2d24..3ee5fcf5 100644 --- a/CSharpCodeAnalyst/Common/SearchExpression.cs +++ b/CSharpCodeAnalyst/Shared/Search/SearchExpression.cs @@ -1,7 +1,7 @@ using System.Text.RegularExpressions; using CodeGraph.Graph; -namespace CSharpCodeAnalyst.Common; +namespace CSharpCodeAnalyst.Shared.Search; /// /// Helper to build (very) simple search expressions with AND/OR/TERM diff --git a/CSharpCodeAnalyst/Common/SearchExpressionFactory.cs b/CSharpCodeAnalyst/Shared/Search/SearchExpressionFactory.cs similarity index 96% rename from CSharpCodeAnalyst/Common/SearchExpressionFactory.cs rename to CSharpCodeAnalyst/Shared/Search/SearchExpressionFactory.cs index 47839019..b7301795 100644 --- a/CSharpCodeAnalyst/Common/SearchExpressionFactory.cs +++ b/CSharpCodeAnalyst/Shared/Search/SearchExpressionFactory.cs @@ -1,4 +1,4 @@ -namespace CSharpCodeAnalyst.Common; +namespace CSharpCodeAnalyst.Shared.Search; internal static class SearchExpressionFactory { diff --git a/CSharpCodeAnalyst/Areas/Shared/CodeElementLineTemplate.xaml b/CSharpCodeAnalyst/Shared/UI/CodeElementLineTemplate.xaml similarity index 89% rename from CSharpCodeAnalyst/Areas/Shared/CodeElementLineTemplate.xaml rename to CSharpCodeAnalyst/Shared/UI/CodeElementLineTemplate.xaml index ea01bbfd..96547429 100644 --- a/CSharpCodeAnalyst/Areas/Shared/CodeElementLineTemplate.xaml +++ b/CSharpCodeAnalyst/Shared/UI/CodeElementLineTemplate.xaml @@ -2,12 +2,12 @@ xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:shared="clr-namespace:CSharpCodeAnalyst.Areas.Shared" + xmlns:ui="clr-namespace:CSharpCodeAnalyst.Shared.UI" mc:Ignorable="d"> - + diff --git a/CSharpCodeAnalyst/Areas/Shared/CodeElementLineViewModel.cs b/CSharpCodeAnalyst/Shared/UI/CodeElementLineViewModel.cs similarity index 90% rename from CSharpCodeAnalyst/Areas/Shared/CodeElementLineViewModel.cs rename to CSharpCodeAnalyst/Shared/UI/CodeElementLineViewModel.cs index 247e87b8..a11537e4 100644 --- a/CSharpCodeAnalyst/Areas/Shared/CodeElementLineViewModel.cs +++ b/CSharpCodeAnalyst/Shared/UI/CodeElementLineViewModel.cs @@ -1,8 +1,8 @@ using System.Windows.Media.Imaging; using CodeGraph.Graph; -using CSharpCodeAnalyst.Messages; +using CSharpCodeAnalyst.Shared.Messages; -namespace CSharpCodeAnalyst.Areas.Shared; +namespace CSharpCodeAnalyst.Shared.UI; internal class Sorter : Comparer { diff --git a/CSharpCodeAnalyst/Wpf/IconLoader.cs b/CSharpCodeAnalyst/Shared/Wpf/IconLoader.cs similarity index 95% rename from CSharpCodeAnalyst/Wpf/IconLoader.cs rename to CSharpCodeAnalyst/Shared/Wpf/IconLoader.cs index 6b6b4cb1..8522aae1 100644 --- a/CSharpCodeAnalyst/Wpf/IconLoader.cs +++ b/CSharpCodeAnalyst/Shared/Wpf/IconLoader.cs @@ -1,7 +1,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; -namespace CSharpCodeAnalyst.Wpf; +namespace CSharpCodeAnalyst.Shared.Wpf; internal static class IconLoader { diff --git a/CSharpCodeAnalyst/Wpf/ImageCrop.cs b/CSharpCodeAnalyst/Shared/Wpf/ImageCrop.cs similarity index 99% rename from CSharpCodeAnalyst/Wpf/ImageCrop.cs rename to CSharpCodeAnalyst/Shared/Wpf/ImageCrop.cs index 1138d48b..3991f164 100644 --- a/CSharpCodeAnalyst/Wpf/ImageCrop.cs +++ b/CSharpCodeAnalyst/Shared/Wpf/ImageCrop.cs @@ -1,7 +1,7 @@ using System.Windows; using System.Windows.Media.Imaging; -namespace CSharpCodeAnalyst.Wpf; +namespace CSharpCodeAnalyst.Shared.Wpf; public static class ImageCrop { diff --git a/CSharpCodeAnalyst/Wpf/Mru.cs b/CSharpCodeAnalyst/Shared/Wpf/Mru.cs similarity index 85% rename from CSharpCodeAnalyst/Wpf/Mru.cs rename to CSharpCodeAnalyst/Shared/Wpf/Mru.cs index b9eee98e..84fc6831 100644 --- a/CSharpCodeAnalyst/Wpf/Mru.cs +++ b/CSharpCodeAnalyst/Shared/Wpf/Mru.cs @@ -1,6 +1,6 @@ using System.Windows.Input; -namespace CSharpCodeAnalyst.Wpf; +namespace CSharpCodeAnalyst.Shared.Wpf; internal class Mru(string path, ICommand command) { diff --git a/CSharpCodeAnalyst/Wpf/VisualTreeFinder.cs b/CSharpCodeAnalyst/Shared/Wpf/VisualTreeFinder.cs similarity index 94% rename from CSharpCodeAnalyst/Wpf/VisualTreeFinder.cs rename to CSharpCodeAnalyst/Shared/Wpf/VisualTreeFinder.cs index d632a5b7..66ecbffe 100644 --- a/CSharpCodeAnalyst/Wpf/VisualTreeFinder.cs +++ b/CSharpCodeAnalyst/Shared/Wpf/VisualTreeFinder.cs @@ -1,7 +1,7 @@ using System.Windows; using System.Windows.Media; -namespace CSharpCodeAnalyst.Wpf; +namespace CSharpCodeAnalyst.Shared.Wpf; public static class VisualTreeFinder { diff --git a/CSharpCodeAnalyst/Wpf/WpfCommand.cs b/CSharpCodeAnalyst/Shared/Wpf/WpfCommand.cs similarity index 97% rename from CSharpCodeAnalyst/Wpf/WpfCommand.cs rename to CSharpCodeAnalyst/Shared/Wpf/WpfCommand.cs index 301c5b04..78795673 100644 --- a/CSharpCodeAnalyst/Wpf/WpfCommand.cs +++ b/CSharpCodeAnalyst/Shared/Wpf/WpfCommand.cs @@ -1,6 +1,6 @@ using System.Windows.Input; -namespace CSharpCodeAnalyst.Wpf; +namespace CSharpCodeAnalyst.Shared.Wpf; public class WpfCommand : ICommand { diff --git a/CodeGraph/Algorithms/Traversal/Traversal.cs b/CodeGraph/Algorithms/Traversal/Traversal.cs deleted file mode 100644 index 12ccbb00..00000000 --- a/CodeGraph/Algorithms/Traversal/Traversal.cs +++ /dev/null @@ -1,40 +0,0 @@ -using CodeGraph.Graph; - -namespace CodeGraph.Algorithms.Traversal; - -public static class Traversal -{ - public static void Dfs(CodeElement element, Action handler) - { - HashSet visited = - [ - element.Id - ]; - - foreach (var child in element.Children) - { - if (!visited.Contains(child.Id)) - { - Dfs(child, visited, handler); - } - } - - handler(element); - } - - - private static void Dfs(CodeElement element, HashSet visited, Action handler) - { - visited.Add(element.Id); - - foreach (var child in element.Children) - { - if (!visited.Contains(child.Id)) - { - Dfs(child, visited, handler); - } - } - - handler(element); - } -} \ No newline at end of file diff --git a/CodeGraph/Graph/CodeElement.cs b/CodeGraph/Graph/CodeElement.cs index 063d3755..055182a5 100644 --- a/CodeGraph/Graph/CodeElement.cs +++ b/CodeGraph/Graph/CodeElement.cs @@ -1,5 +1,4 @@ using System.Diagnostics; -using CodeGraph.Algorithms.Traversal; namespace CodeGraph.Graph; @@ -180,4 +179,41 @@ public void MoveTo(CodeElement newParent) // Update full name Traversal.Dfs(newParent, n => n.FullName = n.GetFullPath()); } + + private static class Traversal + { + public static void Dfs(CodeElement element, Action handler) + { + HashSet visited = + [ + element.Id + ]; + + foreach (var child in element.Children) + { + if (!visited.Contains(child.Id)) + { + Dfs(child, visited, handler); + } + } + + handler(element); + } + + + private static void Dfs(CodeElement element, HashSet visited, Action handler) + { + visited.Add(element.Id); + + foreach (var child in element.Children) + { + if (!visited.Contains(child.Id)) + { + Dfs(child, visited, handler); + } + } + + handler(element); + } + } } \ No newline at end of file diff --git a/Tests/UnitTests/ArchitecturalRules/AnalyzerIntegrationTests.cs b/Tests/UnitTests/ArchitecturalRules/AnalyzerIntegrationTests.cs index 1fc39e5e..e421fbdd 100644 --- a/Tests/UnitTests/ArchitecturalRules/AnalyzerIntegrationTests.cs +++ b/Tests/UnitTests/ArchitecturalRules/AnalyzerIntegrationTests.cs @@ -1,7 +1,7 @@ using CodeGraph.Graph; using CodeParserTests.Helper; -using CSharpCodeAnalyst.Analyzers.ArchitecturalRules; -using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; +using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; namespace CodeParserTests.UnitTests.ArchitecturalRules; diff --git a/Tests/UnitTests/ArchitecturalRules/PatternMatcherTests.cs b/Tests/UnitTests/ArchitecturalRules/PatternMatcherTests.cs index 63e8f0f7..eb113ac5 100644 --- a/Tests/UnitTests/ArchitecturalRules/PatternMatcherTests.cs +++ b/Tests/UnitTests/ArchitecturalRules/PatternMatcherTests.cs @@ -1,5 +1,5 @@ using CodeParserTests.Helper; -using CSharpCodeAnalyst.Analyzers.ArchitecturalRules; +using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; namespace CodeParserTests.UnitTests.ArchitecturalRules; diff --git a/Tests/UnitTests/ArchitecturalRules/RuleParserTests.cs b/Tests/UnitTests/ArchitecturalRules/RuleParserTests.cs index 00cb892a..a5059453 100644 --- a/Tests/UnitTests/ArchitecturalRules/RuleParserTests.cs +++ b/Tests/UnitTests/ArchitecturalRules/RuleParserTests.cs @@ -1,5 +1,5 @@ -using CSharpCodeAnalyst.Analyzers.ArchitecturalRules; -using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; +using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; namespace CodeParserTests.UnitTests.ArchitecturalRules; diff --git a/Tests/UnitTests/ArchitecturalRules/RuleValidationTests.cs b/Tests/UnitTests/ArchitecturalRules/RuleValidationTests.cs index 7006c1f6..7da0d20c 100644 --- a/Tests/UnitTests/ArchitecturalRules/RuleValidationTests.cs +++ b/Tests/UnitTests/ArchitecturalRules/RuleValidationTests.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; using CodeParserTests.Helper; -using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; namespace CodeParserTests.UnitTests.ArchitecturalRules; diff --git a/Tests/UnitTests/Graph/MsaglHierarchicalBuilderTests.cs b/Tests/UnitTests/Graph/MsaglHierarchicalBuilderTests.cs index 4c2e377a..cb589cac 100644 --- a/Tests/UnitTests/Graph/MsaglHierarchicalBuilderTests.cs +++ b/Tests/UnitTests/Graph/MsaglHierarchicalBuilderTests.cs @@ -1,6 +1,6 @@ using CodeGraph.Graph; -using CSharpCodeAnalyst.Areas.GraphArea; -using CSharpCodeAnalyst.Areas.GraphArea.Filtering; +using CSharpCodeAnalyst.Features.Graph; +using CSharpCodeAnalyst.Features.Graph.Filtering; namespace CodeParserTests.UnitTests.Graph; diff --git a/Tests/UnitTests/Import/JdepsReaderTest.cs b/Tests/UnitTests/Import/JdepsReaderTest.cs index d32970ea..962c7e90 100644 --- a/Tests/UnitTests/Import/JdepsReaderTest.cs +++ b/Tests/UnitTests/Import/JdepsReaderTest.cs @@ -1,6 +1,6 @@ using System.Text; using CodeGraph.Graph; -using CSharpCodeAnalyst.Import; +using CSharpCodeAnalyst.Features.Import; namespace CodeParserTests.UnitTests.Import; diff --git a/Tests/UnitTests/Search/PascalCaseSearchTests.cs b/Tests/UnitTests/Search/PascalCaseSearchTests.cs index ca3767bd..a734339d 100644 --- a/Tests/UnitTests/Search/PascalCaseSearchTests.cs +++ b/Tests/UnitTests/Search/PascalCaseSearchTests.cs @@ -1,4 +1,4 @@ -using CSharpCodeAnalyst.Common; +using CSharpCodeAnalyst.Shared.Search; namespace CodeParserTests.UnitTests.Search;