Skip to content

Commit 802139e

Browse files
chore: structure update
1 parent 6d3b380 commit 802139e

File tree

8 files changed

+58
-34
lines changed

8 files changed

+58
-34
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ dotnet_diagnostic.IDE0035.severity = warning
5656
# IDE0045: Use conditional expression for assignment
5757
dotnet_style_prefer_conditional_expression_over_assignment = false
5858

59+
# IDE0046: Use conditional expression for return
60+
dotnet_style_prefer_conditional_expression_over_return = false
61+
5962
# IDE0049: Use language keywords instead of framework type names for type references
6063
dotnet_diagnostic.IDE0049.severity = warning
6164

@@ -71,6 +74,12 @@ dotnet_diagnostic.IDE0079.severity = warning
7174
# IDE0160-IDE0161: Namespace declaration preferences
7275
csharp_style_namespace_declarations = file_scoped
7376

77+
# IDE0130: Namespace does not match folder structure
78+
dotnet_diagnostic.IDE0130.severity = warning
79+
80+
# IDE0290: Use primary constructor
81+
csharp_style_prefer_primary_constructors = false
82+
7483
# IDE1006: Naming styles
7584
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = warning
7685
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields

src/BlazorDesktop.sln renamed to BlazorDesktop.sln

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.32112.339
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorDesktop", "BlazorDesktop\BlazorDesktop.csproj", "{36822AC5-A3A4-4AFA-A3EC-0C9F7DBFAC39}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorDesktop", "src\BlazorDesktop\BlazorDesktop.csproj", "{36822AC5-A3A4-4AFA-A3EC-0C9F7DBFAC39}"
77
EndProject
8-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorDesktop.Sample", "BlazorDesktop.Sample\BlazorDesktop.Sample.csproj", "{A05779F3-CE78-4455-BBCB-FF1ED77CD5E7}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorDesktop.Sample", "src\BlazorDesktop.Sample\BlazorDesktop.Sample.csproj", "{A05779F3-CE78-4455-BBCB-FF1ED77CD5E7}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorDesktop.Templates", "BlazorDesktop.Templates\BlazorDesktop.Templates.csproj", "{69F353B9-60B3-4E9B-87EE-4A628A3CFA81}"
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorDesktop.Templates", "src\BlazorDesktop.Templates\BlazorDesktop.Templates.csproj", "{69F353B9-60B3-4E9B-87EE-4A628A3CFA81}"
1111
EndProject
1212
Global
1313
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/Directory.Build.props renamed to Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3333
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
3434
<GenerateDocumentationFile>true</GenerateDocumentationFile>
35-
<BaseOutputPath>$(MSBuildThisFileDirectory)../bin/$(MSBuildProjectName)</BaseOutputPath>
35+
<BaseOutputPath>$(MSBuildThisFileDirectory)bin/$(MSBuildProjectName)</BaseOutputPath>
3636
<Copyright>© $(Authors). All rights reserved.</Copyright>
3737
<RepositoryType>git</RepositoryType>
3838
<IncludeSymbols>true</IncludeSymbols>
@@ -44,9 +44,9 @@
4444
</PropertyGroup>
4545

4646
<ItemGroup Condition="$(IsPackable) == 'true'">
47-
<None Include="$(MSBuildThisFileDirectory)../assets/nuget.png" Visible="false" Pack="true" PackagePath="" />
48-
<None Include="$(MSBuildThisFileDirectory)../README.md" Visible="false" Pack="true" PackagePath="" />
49-
<None Include="$(MSBuildThisFileDirectory)../LICENSE.txt" Visible="False" Pack="true" PackagePath="" />
47+
<None Include="$(MSBuildThisFileDirectory)assets/nuget.png" Visible="false" Pack="true" PackagePath="" />
48+
<None Include="$(MSBuildThisFileDirectory)README.md" Visible="false" Pack="true" PackagePath="" />
49+
<None Include="$(MSBuildThisFileDirectory)LICENSE.txt" Visible="False" Pack="true" PackagePath="" />
5050
</ItemGroup>
5151

5252
</Project>

global.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"sdk": {
3+
"version": "8.0.302",
4+
"allowPrerelease": false,
5+
"rollForward": "latestFeature"
6+
}
7+
}

src/BlazorDesktop/BlazorDesktop.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Wpf" Version="8.0.3" />
13+
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Wpf" Version="8.0.61" />
1414
<PackageReference Include="WebView2.Runtime.AutoInstaller" Version="1.0.0" />
1515
</ItemGroup>
1616

src/BlazorDesktop/Services/BlazorDesktopService.cs

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,48 @@ namespace BlazorDesktop.Services;
1414
/// <summary>
1515
/// The blazor desktop service.
1616
/// </summary>
17-
/// <remarks>
18-
/// Creates a <see cref="BlazorDesktopService"/> instance.
19-
/// </remarks>
20-
/// <param name="lifetime">The <see cref="IHostApplicationLifetime"/>.</param>
21-
/// <param name="services">The <see cref="IServiceProvider"/>.</param>
22-
/// <param name="logger">The <see cref="ILogger{TCategoryName}"/>.</param>
23-
/// <param name="webViewInstaller">The <see cref="WebViewInstaller"/>.</param>
24-
public partial class BlazorDesktopService(IHostApplicationLifetime lifetime, IServiceProvider services, ILogger<BlazorDesktopService> logger, WebViewInstaller webViewInstaller) : IHostedService, IDisposable
17+
public partial class BlazorDesktopService : IHostedService, IDisposable
2518
{
19+
/// <summary>
20+
/// The cancellation token registration.
21+
/// </summary>
22+
private CancellationTokenRegistration _applicationStoppingRegistration;
23+
2624
/// <summary>
2725
/// The application lifetime.
2826
/// </summary>
29-
private readonly IHostApplicationLifetime _lifetime = lifetime;
27+
private readonly IHostApplicationLifetime _lifetime;
3028

3129
/// <summary>
3230
/// The services.
3331
/// </summary>
34-
private readonly IServiceProvider _services = services;
32+
private readonly IServiceProvider _services;
3533

3634
/// <summary>
3735
/// The <see cref="ILogger{TCategoryName}"/>.
3836
/// </summary>
39-
private readonly ILogger<BlazorDesktopService> _logger = logger;
37+
private readonly ILogger<BlazorDesktopService> _logger;
4038

4139
/// <summary>
4240
/// The web view installer.
4341
/// </summary>
44-
private readonly WebViewInstaller _webViewInstaller = webViewInstaller;
42+
private readonly WebViewInstaller _webViewInstaller;
4543

4644
/// <summary>
47-
/// The cancellation token registration.
45+
/// Creates a <see cref="BlazorDesktopService"/> instance.
4846
/// </summary>
49-
private CancellationTokenRegistration _applicationStoppingRegistration;
47+
/// <param name="lifetime">The <see cref="IHostApplicationLifetime"/>.</param>
48+
/// <param name="services">The <see cref="IServiceProvider"/>.</param>
49+
/// <param name="logger">The <see cref="ILogger{TCategoryName}"/>.</param>
50+
/// <param name="webViewInstaller">The <see cref="WebViewInstaller"/>.</param>
51+
public BlazorDesktopService(IHostApplicationLifetime lifetime, IServiceProvider services, ILogger<BlazorDesktopService> logger, WebViewInstaller webViewInstaller)
52+
{
53+
_applicationStoppingRegistration = new();
54+
_lifetime = lifetime;
55+
_services = services;
56+
_logger = logger;
57+
_webViewInstaller = webViewInstaller;
58+
}
5059

5160
/// <summary>
5261
/// Starts the service.

src/BlazorDesktop/Wpf/BlazorDesktopEventForwarder.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ namespace BlazorDesktop.Wpf;
99
/// <summary>
1010
/// The blazor desktop event forwarder.
1111
/// </summary>
12-
/// <remarks>
13-
/// Creates an instance of <see cref="BlazorDesktopEventForwarder"/>.
14-
/// </remarks>
15-
/// <param name="target">The target handle.</param>
16-
public partial class BlazorDesktopEventForwarder(IntPtr target)
12+
public partial class BlazorDesktopEventForwarder
1713
{
1814
/// <summary>
1915
/// Posted when the user presses the left mouse button while the cursor is
@@ -29,7 +25,16 @@ public partial class BlazorDesktopEventForwarder(IntPtr target)
2925
/// <summary>
3026
/// The target
3127
/// </summary>
32-
private readonly IntPtr _target = target;
28+
private readonly IntPtr _target;
29+
30+
/// <summary>
31+
/// Creates an instance of <see cref="BlazorDesktopEventForwarder"/>.
32+
/// </summary>
33+
/// <param name="target">The target handle.</param>
34+
public BlazorDesktopEventForwarder(IntPtr target)
35+
{
36+
_target = target;
37+
}
3338

3439
/// <summary>
3540
/// Occurs when the mouse starts dragging.

src/global.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)