From 08ed528420001160892f345b31737296f73f00f4 Mon Sep 17 00:00:00 2001 From: "Artyom V. Gorchakov" Date: Tue, 27 Oct 2020 01:55:34 +0300 Subject: [PATCH] feature: Use XamlX for Type Resolution (#5) --- README.md | 18 +- .../SignUpView.xaml.cs | 5 +- .../Infrastructure/MiniCompiler.cs | 42 +++ .../MiniNamedControlCollector.cs | 54 ++++ .../PhysicalFileDebugger.cs} | 7 +- .../Infrastructure/RoslynTypeSystem.cs | 281 ++++++++++++++++++ .../NameReferenceGenerator.cs | 52 +--- .../Parsers/INameReferenceXamlParser.cs | 4 +- .../XamlXCompiledNameReferenceXamlParser.cs | 12 - .../Parsers/XamlXNameReferenceXamlParser.cs | 32 ++ .../XamlXRawNameReferenceXamlParser.cs | 67 ----- .../XmlDocumentNameReferenceXamlParser.cs | 2 +- 12 files changed, 442 insertions(+), 134 deletions(-) create mode 100644 src/XamlNameReferenceGenerator/Infrastructure/MiniCompiler.cs create mode 100644 src/XamlNameReferenceGenerator/Infrastructure/MiniNamedControlCollector.cs rename src/XamlNameReferenceGenerator/{NameReferenceDebugger.cs => Infrastructure/PhysicalFileDebugger.cs} (67%) create mode 100644 src/XamlNameReferenceGenerator/Infrastructure/RoslynTypeSystem.cs delete mode 100644 src/XamlNameReferenceGenerator/Parsers/XamlXCompiledNameReferenceXamlParser.cs create mode 100644 src/XamlNameReferenceGenerator/Parsers/XamlXNameReferenceXamlParser.cs delete mode 100644 src/XamlNameReferenceGenerator/Parsers/XamlXRawNameReferenceXamlParser.cs diff --git a/README.md b/README.md index ef13ce14e3..f9e58c6a5a 100644 --- a/README.md +++ b/README.md @@ -52,22 +52,20 @@ For the [`SignUpView` view class](https://github.com/worldbeater/XamlNameReferen ```cs // -using System; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace XamlNameReferenceGenerator.Sandbox { public partial class SignUpView { - public TextBox UserNameTextBox => this.FindControl("UserNameTextBox"); - public TextBlock UserNameValidation => this.FindControl("UserNameValidation"); - public TextBox PasswordTextBox => this.FindControl("PasswordTextBox"); - public TextBlock PasswordValidation => this.FindControl("PasswordValidation"); - public TextBox ConfirmPasswordTextBox => this.FindControl("ConfirmPasswordTextBox"); - public TextBlock ConfirmPasswordValidation => this.FindControl("ConfirmPasswordValidation"); - public Button SignUpButton => this.FindControl