Skip to content

Commit 88ed4d7

Browse files
committed
适应 Avalonia-11.1.0-beta1
适应对 ExpressionObserver 的调整
1 parent 664debf commit 88ed4d7

7 files changed

Lines changed: 21 additions & 22 deletions

File tree

src/Antelcat.I18N.SourceGenerators.Shared/Generators/ResourceKeysGenerator.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Microsoft.CodeAnalysis;
99
using Microsoft.CodeAnalysis.CSharp;
1010
using Microsoft.CodeAnalysis.CSharp.Syntax;
11+
using Microsoft.CodeAnalysis.Internal;
1112
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
1213

1314
namespace Antelcat.I18N.WPF.SourceGenerators.Generators;

src/Antelcat.I18N.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Antelcat.I18N.Abstractions"
4545
EndProject
4646
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Antelcat.I18N.Abstractions.Shared", "Antelcat.I18N.Abstractions.Shared\Antelcat.I18N.Abstractions.Shared.shproj", "{F3F24657-983C-46FF-B928-ADD03557C562}"
4747
EndProject
48-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Feast.CodeAnalysis.LiteralGenerator", "..\extern\CodeAnalysis.Extensions\src\Feast.CodeAnalysis.LiteralGenerator\Feast.CodeAnalysis.LiteralGenerator.csproj", "{13AC62C7-D492-40B2-8231-B9A2545D7388}"
48+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Feast.CodeAnalysis.LiteralGenerator", "..\extern\CodeAnalysis.Extensions\src\Feast.CodeAnalysis.LiteralGenerator\Feast.CodeAnalysis.LiteralGenerator.csproj", "{13AC62C7-D492-40B2-8231-B9A2545D7388}"
4949
EndProject
5050
Global
5151
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -116,6 +116,7 @@ Global
116116
SolutionGuid = {73D6AEFA-1477-4119-9F85-0DA27E35BDB8}
117117
EndGlobalSection
118118
GlobalSection(SharedMSBuildProjectFiles) = preSolution
119+
..\extern\CodeAnalysis.Extensions\src\Feast.CodeAnalysis.Shared\Feast.CodeAnalysis.Shared.projitems*{13ac62c7-d492-40b2-8231-b9a2545d7388}*SharedItemsImports = 5
119120
Antelcat.I18N.SourceGenerators.Shared\Antelcat.I18N.SourceGenerators.Shared.projitems*{15d71dc2-f53d-42ec-85e4-4982f6e351a5}*SharedItemsImports = 13
120121
Antelcat.I18N.Shared\Antelcat.I18N.Shared.projitems*{28f904c6-3b6d-4140-90ff-62a6bd87b0c6}*SharedItemsImports = 13
121122
Antelcat.I18N.Abstractions.Shared\Antelcat.I18N.Abstractions.Shared.projitems*{2ba15a8e-6c3e-4b33-bff4-d9255202d71d}*SharedItemsImports = 5

src/Avalonia/Avalonia/Antelcat.I18N.Avalonia.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
<IsPackable>true</IsPackable>
88
<LangVersion>preview</LangVersion>
99

10-
<Version>1.0.1</Version>
11-
<FileVersion>1.0.1</FileVersion>
12-
<AssemblyVersion>1.0.1</AssemblyVersion>
10+
<Version>1.0.2</Version>
11+
<FileVersion>1.0.2</FileVersion>
12+
<AssemblyVersion>1.0.2</AssemblyVersion>
1313

1414
<Authors>Antelcat</Authors>
1515
<Title>Antelcat.I18N.Avalonia</Title>
1616
<PackageId>Antelcat.I18N.Avalonia</PackageId>
1717
<RootNamespace>Antelcat.I18N.Avalonia</RootNamespace>
1818
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
19-
<PackageReleaseNotes>Fix string template using args of none string type</PackageReleaseNotes>
19+
<PackageReleaseNotes>Adapt to avalonia-11.1.0-beta1</PackageReleaseNotes>
2020
<Copyright>Copyright Antelcat. All rights reserved</Copyright>
2121
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
2222
<PackageTags>dotnet;Avalonia;markup;extension;MVVM;i18n;language;binding;.NET;</PackageTags>
@@ -34,7 +34,7 @@
3434
</PropertyGroup>
3535

3636
<ItemGroup>
37-
<PackageReference Include="Avalonia" Version="11.0.0"/>
37+
<PackageReference Include="Avalonia" Version="11.1.0-beta1" />
3838
</ItemGroup>
3939

4040
<ItemGroup>

src/Avalonia/Avalonia/I18NExtension.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@ static I18NExtension()
3131

3232
lock (ResourceProvider.Providers)
3333
{
34-
foreach (var provider in ResourceProvider.Providers)
35-
{
36-
var action = RegisterLanguageSource(provider, true);
37-
updateActions.Add(action);
38-
}
34+
updateActions.AddRange(
35+
ResourceProvider.Providers.Select(provider => RegisterLanguageSource(provider, true)));
3936

4037
ResourceProvider.Providers.CollectionChanged += (_, e) =>
4138
{

src/Avalonia/Avalonia/Internals/ExpandoObjectPropertyAccessorPlugin.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ public IPropertyAccessor Start(WeakReference<object?> reference, string property
1717

1818
public static void Register(ExpandoObject target)
1919
{
20-
if (Assembly.GetAssembly(typeof(IPropertyAccessorPlugin))
20+
/*if (Assembly.GetAssembly(typeof(IPropertyAccessorPlugin))
2121
.GetType("Avalonia.Data.Core.ExpressionObserver")
22-
.GetField("PropertyAccessors", BindingFlags.Public | BindingFlags.Static)!
23-
.GetValue(null) is IList<IPropertyAccessorPlugin> { } plugins)
24-
{
25-
plugins.Add(new ExpandoObjectPropertyAccessorPlugin(target));
26-
ExpandoAccessor.Source = target;
27-
}
22+
.GetField("PropertyAccessors", BindingFlags.Public | BindingFlags.Static)?
23+
.GetValue(null) is not IList<IPropertyAccessorPlugin> plugins) return;
24+
plugins.Add(new ExpandoObjectPropertyAccessorPlugin(target));*/
25+
BindingPlugins.PropertyAccessors.Add(new ExpandoObjectPropertyAccessorPlugin(target));
26+
ExpandoAccessor.Source = target;
2827
}
2928

3029
private class ExpandoAccessor : IPropertyAccessor

src/Avalonia/Demo/Antelcat.I18N.Avalonia.Demo.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
<TrimmableAssembly Include="Avalonia.Themes.Default" />
2323
</ItemGroup>
2424
<ItemGroup>
25-
<PackageReference Include="Avalonia" Version="11.0.5" />
26-
<PackageReference Include="Avalonia.Desktop" Version="11.0.5" />
25+
<PackageReference Include="Avalonia" Version="11.1.0-beta1" />
26+
<PackageReference Include="Avalonia.Desktop" Version="11.1.0-beta1" />
2727
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
28-
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.5" />
29-
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.5" />
28+
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.0-beta1" />
29+
<PackageReference Include="Avalonia.ReactiveUI" Version="11.1.0-beta1" />
3030
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
3131
<PackageReference Include="FluentAvaloniaUI" Version="2.0.4" />
3232
</ItemGroup>

src/WPF/Library/Windows/MainWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ public MainWindow()
1212
InitializeComponent();
1313
DataContext = new ViewModel();
1414
}
15+
1516
}
1617
}

0 commit comments

Comments
 (0)