code style

This commit is contained in:
Lightczx
2024-05-09 16:25:21 +08:00
parent 5bfc790ea2
commit 7da778699b
4 changed files with 18 additions and 1 deletions

View File

@@ -48,6 +48,8 @@ public sealed partial class App : Application
/// <param name="serviceProvider">服务提供器</param>
public App(IServiceProvider serviceProvider)
{
// DispatcherShutdownMode = DispatcherShutdownMode.OnExplicitShutdown;
// Load app resource
InitializeComponent();
activation = serviceProvider.GetRequiredService<IActivation>();

View File

@@ -32,6 +32,7 @@ internal sealed partial class IdentifyMonitorWindow : Window
{
List<IdentifyMonitorWindow> windows = [];
// TODO: the order here is not sync with unity.
IReadOnlyList<DisplayArea> displayAreas = DisplayArea.FindAll();
for (int i = 0; i < displayAreas.Count; i++)
{

View File

@@ -17,7 +17,8 @@ using static Snap.Hutao.Win32.Macros;
namespace Snap.Hutao.Service.Game.Automation.ScreenCapture;
[ConstructorGenerated]
internal sealed partial class GameScreenCaptureService
[Injection(InjectAs.Singleton, typeof(IGameScreenCaptureService))]
internal sealed partial class GameScreenCaptureService : IGameScreenCaptureService
{
private readonly ILogger<GameScreenCaptureService> logger;

View File

@@ -0,0 +1,13 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Win32.Foundation;
namespace Snap.Hutao.Service.Game.Automation.ScreenCapture;
internal interface IGameScreenCaptureService
{
bool IsSupported();
bool TryStartCapture(HWND hwnd, [NotNullWhen(true)] out GameScreenCaptureSession? session);
}