Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added XML formatting and styling #1

Merged
merged 5 commits into from
Jul 13, 2024
Merged

Added XML formatting and styling #1

merged 5 commits into from
Jul 13, 2024

Conversation

galadril
Copy link
Owner

PR Classification

This pull request introduces new features and code cleanup by adding new classes for XML and enum handling, reorganizing converter namespaces, and simplifying syntax across the application.

PR Summary

The changes enhance the application's functionality and code readability by introducing new utility classes and reorganizing existing ones. Key updates include:

  • Added XmlFormatter and EnumItemsConverter classes for improved XML and enum handling.
  • Reorganized converter classes into the WireMockInspector.Converters namespace for better organization.
  • Simplified object instantiation using target-typed new expressions in multiple files.
  • Introduced XmlSyntaxHighlighter for XML syntax highlighting in CodeBlockViewer.cs.
  • Updated XAML files to reference the new converter namespace and utilize the newly introduced converters.

- Removed `HttpStatusCodeToDescriptionConverter`, `RequestMethodToColorConverter`, and `ResponseCodeToColorConverter` from `WireMockInspector.ViewModels`.
- Re-added the above converters in `WireMockInspector.Converters` for better modularity.
- Updated namespace references in XAML files from `viewModels` to `converters`.
- Introduced `XmlSyntaxHighlighter` in `WireMockInspector.Views.Transformer` for XML syntax highlighting.
- Enhanced `CodeBlockViewer.cs` to support XML highlighting, improving readability.
- Adjusted XAML files to use the new converter namespace, ensuring UI consistency.
This commit represents a significant refactoring and enhancement of the converter usage within the WireMockInspector application. Key changes include the relocation of converter classes (`EnumItemsConverter`, `GraphConverter`, `StringListConverter`, `StringMatchConverter`) from the `WireMockInspector.ViewModels` namespace to a new `WireMockInspector.Converters` namespace, improving modularity and clarity. New converter classes have been added, encapsulating the conversion logic for better reusability. Updates in various XAML files reflect these namespace changes, ensuring correct converter references in data-binding expressions. Additionally, unused `using` directives have been cleaned up, and a new `SettingsWrapperTemplateSelector` class has been introduced to enhance dynamic UI generation capabilities. These changes collectively aim to improve the maintainability and functionality of the application's UI data presentation.
- Adopted target-typed `new` expressions across various files for cleaner instantiation.
- Enhanced graph drawing in `GraphConverter.cs` with streamlined object creation.
- Simplified `XmlDocument` object instantiation in multiple files for conciseness.
- Updated singleton patterns in converters and formatters to modern C# practices.
- Improved XML content formatting in markdown with `.TryToReformat()` in `MainWindowViewModel.cs`.
- Refined syntax highlighting in `CSharpSyntaxHighlighter.cs`, `JsonSyntaxHighlighter.cs`, and `XmlSyntaxHighlighter.cs` with updated regex patterns and object instantiation.
- Added `XmlFormatter.cs` for better XML handling, including escaping, pretty-printing, and conversion utilities.
- Adjusted `Fluid.Core` package version in `WireMockInspector.csproj` for compatibility or feature requirements.
@galadril galadril merged commit 9b9dbbf into main Jul 13, 2024
@galadril galadril deleted the feature/xml-formatter branch July 13, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant