Skip to content

Commit bf2c4c9

Browse files
Merge pull request #1 from atc-net/feature/Improve-template-resolver
Improve template resolver
2 parents c42c4e8 + a0b59fc commit bf2c4c9

12 files changed

+45
-36
lines changed

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<ItemGroup Label="Code Analyzers">
4242
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
4343
<PackageReference Include="Asyncify" Version="0.9.7" PrivateAssets="All" />
44-
<PackageReference Include="Meziantou.Analyzer" Version="2.0.62" PrivateAssets="All" />
44+
<PackageReference Include="Meziantou.Analyzer" Version="2.0.63" PrivateAssets="All" />
4545
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" />
4646
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="All" />
4747
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.4.0.72892" PrivateAssets="All" />

src/Atc.Installer.Wpf.App/App.xaml

+1-6
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,10 @@
88
<ResourceDictionary>
99

1010
<ResourceDictionary.MergedDictionaries>
11-
<ResourceDictionary Source="pack://application:,,,/Atc.Wpf.Controls;component/Styles/Controls.xaml" />
1211
<ResourceDictionary Source="pack://application:,,,/Atc.Wpf.Theming;component/Styles/Default.xaml" />
12+
<ResourceDictionary Source="pack://application:,,,/Atc.Wpf.Controls;component/Styles/Controls.xaml" />
1313
</ResourceDictionary.MergedDictionaries>
1414

15-
<Style TargetType="MenuItem">
16-
<Setter Property="HorizontalContentAlignment" Value="Left" />
17-
<Setter Property="VerticalContentAlignment" Value="Center" />
18-
</Style>
19-
2015
</ResourceDictionary>
2116
</Application.Resources>
2217
</Application>

src/Atc.Installer.Wpf.App/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
[assembly: AssemblyCompany("atc-net")]
66
[assembly: AssemblyProduct("Atc.Installer")]
77
[assembly: AssemblyTitle("Atc.Installer")]
8-
[assembly: AssemblyVersion("1.0.2.0")]
9-
[assembly: AssemblyInformationalVersion("1.0.2.0")]
10-
[assembly: AssemblyFileVersion("1.0.2.0")]
8+
[assembly: AssemblyVersion("1.0.3.0")]
9+
[assembly: AssemblyInformationalVersion("1.0.3.0")]
10+
[assembly: AssemblyFileVersion("1.0.3.0")]
1111
[assembly: System.Resources.NeutralResourcesLanguage("en")]
1212
[assembly: System.Runtime.Versioning.TargetPlatform("Windows7.0")]
1313
[assembly: System.Runtime.Versioning.SupportedOSPlatform("Windows7.0")]

src/Atc.Installer.Wpf.App/Atc.Installer.Wpf.App.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
</ItemGroup>
4141

4242
<ItemGroup>
43-
<PackageReference Include="Atc.Wpf" Version="2.0.178" />
44-
<PackageReference Include="Atc.Wpf.Controls" Version="2.0.178" />
45-
<PackageReference Include="Atc.Wpf.FontIcons" Version="2.0.178" />
46-
<PackageReference Include="Atc.Wpf.Theming" Version="2.0.178" />
43+
<PackageReference Include="Atc.Wpf" Version="2.0.195" />
44+
<PackageReference Include="Atc.Wpf.Controls" Version="2.0.195" />
45+
<PackageReference Include="Atc.Wpf.FontIcons" Version="2.0.195" />
46+
<PackageReference Include="Atc.Wpf.Theming" Version="2.0.195" />
4747
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
4848
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
4949
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />

src/Atc.Installer.Wpf.ComponentProvider.ElasticSearch/Atc.Installer.Wpf.ComponentProvider.ElasticSearch.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Atc.Wpf" Version="2.0.178" />
12-
<PackageReference Include="Atc.Wpf.Controls" Version="2.0.178" />
13-
<PackageReference Include="Atc.Wpf.FontIcons" Version="2.0.178" />
14-
<PackageReference Include="Atc.Wpf.Theming" Version="2.0.178" />
11+
<PackageReference Include="Atc.Wpf" Version="2.0.195" />
12+
<PackageReference Include="Atc.Wpf.Controls" Version="2.0.195" />
13+
<PackageReference Include="Atc.Wpf.FontIcons" Version="2.0.195" />
14+
<PackageReference Include="Atc.Wpf.Theming" Version="2.0.195" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

src/Atc.Installer.Wpf.ComponentProvider.ElasticSearch/ElasticSearchServerComponentProviderViewModel_Commands.cs

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ private async Task TestConnectionCommandHandler()
2323
{
2424
LogItems.Add(LogItemFactory.CreateTrace("Test connection"));
2525

26+
IsBusy = true;
27+
2628
var (isSucceeded, errorMessage) = await esInstallerService
2729
.TestConnection(
2830
ElasticSearchConnection.WebProtocol!,
@@ -33,6 +35,8 @@ private async Task TestConnectionCommandHandler()
3335
ElasticSearchConnection.Index)
3436
.ConfigureAwait(true);
3537

38+
IsBusy = false;
39+
3640
if (isSucceeded)
3741
{
3842
LogItems.Add(LogItemFactory.CreateInformation("Test connection succeeded"));

src/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer/Atc.Installer.Wpf.ComponentProvider.InternetInformationServer.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Atc.Wpf" Version="2.0.178" />
12-
<PackageReference Include="Atc.Wpf.Controls" Version="2.0.178" />
13-
<PackageReference Include="Atc.Wpf.FontIcons" Version="2.0.178" />
14-
<PackageReference Include="Atc.Wpf.Theming" Version="2.0.178" />
11+
<PackageReference Include="Atc.Wpf" Version="2.0.195" />
12+
<PackageReference Include="Atc.Wpf.Controls" Version="2.0.195" />
13+
<PackageReference Include="Atc.Wpf.FontIcons" Version="2.0.195" />
14+
<PackageReference Include="Atc.Wpf.Theming" Version="2.0.195" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

src/Atc.Installer.Wpf.ComponentProvider.PostgreSql/Atc.Installer.Wpf.ComponentProvider.PostgreSql.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Atc.Wpf" Version="2.0.178" />
12-
<PackageReference Include="Atc.Wpf.Controls" Version="2.0.178" />
13-
<PackageReference Include="Atc.Wpf.FontIcons" Version="2.0.178" />
14-
<PackageReference Include="Atc.Wpf.Theming" Version="2.0.178" />
11+
<PackageReference Include="Atc.Wpf" Version="2.0.195" />
12+
<PackageReference Include="Atc.Wpf.Controls" Version="2.0.195" />
13+
<PackageReference Include="Atc.Wpf.FontIcons" Version="2.0.195" />
14+
<PackageReference Include="Atc.Wpf.Theming" Version="2.0.195" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

src/Atc.Installer.Wpf.ComponentProvider.PostgreSql/PostgreSqlServerComponentProviderViewModel_Commands.cs

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ private async Task TestConnectionCommandHandler()
2323
{
2424
LogItems.Add(LogItemFactory.CreateTrace("Test connection"));
2525

26+
IsBusy = true;
27+
2628
var (isSucceeded, errorMessage) = await pgInstallerService
2729
.TestConnection(
2830
PostgreSqlConnection.HostName!,
@@ -32,6 +34,8 @@ private async Task TestConnectionCommandHandler()
3234
PostgreSqlConnection.Password!)
3335
.ConfigureAwait(true);
3436

37+
IsBusy = false;
38+
3539
if (isSucceeded)
3640
{
3741
LogItems.Add(LogItemFactory.CreateInformation("Test connection succeeded"));

src/Atc.Installer.Wpf.ComponentProvider.WindowsApplication/Atc.Installer.Wpf.ComponentProvider.WindowsApplication.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Atc.Wpf" Version="2.0.178" />
12-
<PackageReference Include="Atc.Wpf.Controls" Version="2.0.178" />
13-
<PackageReference Include="Atc.Wpf.FontIcons" Version="2.0.178" />
14-
<PackageReference Include="Atc.Wpf.Theming" Version="2.0.178" />
11+
<PackageReference Include="Atc.Wpf" Version="2.0.195" />
12+
<PackageReference Include="Atc.Wpf.Controls" Version="2.0.195" />
13+
<PackageReference Include="Atc.Wpf.FontIcons" Version="2.0.195" />
14+
<PackageReference Include="Atc.Wpf.Theming" Version="2.0.195" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

src/Atc.Installer.Wpf.ComponentProvider/Atc.Installer.Wpf.ComponentProvider.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="Atc" Version="2.0.326" />
12-
<PackageReference Include="Atc.Wpf" Version="2.0.178" />
13-
<PackageReference Include="Atc.Wpf.Controls" Version="2.0.178" />
14-
<PackageReference Include="Atc.Wpf.FontIcons" Version="2.0.178" />
15-
<PackageReference Include="Atc.Wpf.Theming" Version="2.0.178" />
12+
<PackageReference Include="Atc.Wpf" Version="2.0.195" />
13+
<PackageReference Include="Atc.Wpf.Controls" Version="2.0.195" />
14+
<PackageReference Include="Atc.Wpf.FontIcons" Version="2.0.195" />
15+
<PackageReference Include="Atc.Wpf.Theming" Version="2.0.195" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

src/Atc.Installer.Wpf.ComponentProvider/ComponentProviderViewModel_LogicBase.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ public virtual bool TryGetStringFromApplicationSetting(
228228
string key,
229229
out string resultValue)
230230
{
231+
if (TryGetStringFromApplicationSettings(key, out var value))
232+
{
233+
resultValue = value;
234+
return true;
235+
}
236+
231237
resultValue = string.Empty;
232238
return false;
233239
}
@@ -401,11 +407,11 @@ protected string ResolveTemplateIfNeededByApplicationSettingsLookup(
401407
var sa = key.Split('|', StringSplitOptions.RemoveEmptyEntries);
402408
if (sa.Length == 2)
403409
{
404-
var refComponentProvider = refComponentProviders.First(x => x.Name == sa[0]);
410+
var refComponentProvider = refComponentProviders.FirstOrDefault(x => x.Name.Equals(sa[0], StringComparison.OrdinalIgnoreCase));
405411
if (refComponentProvider is not null &&
406412
refComponentProvider.TryGetStringFromApplicationSetting(sa[1], out var resultValue))
407413
{
408-
value = resultValue;
414+
value = value.ReplaceTemplateWithKey(key, resultValue);
409415
}
410416
}
411417
}

0 commit comments

Comments
 (0)