初始化提交

This commit is contained in:
2025-09-19 17:42:11 +08:00
commit fde5919d99
84 changed files with 55570 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Media;
using System.Xml;
namespace
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
int screenIndex = 0;
this.Left = (int)(Screen.AllScreens[screenIndex].Bounds.Left / GetDpiScaleX());
this.Top = (int)(Screen.AllScreens[screenIndex].Bounds.Top / GetDpiScaleX());
this.Width = (int)(Screen.AllScreens[screenIndex].Bounds.Width / GetDpiScaleX());
this.Height = (int)(Screen.AllScreens[screenIndex].Bounds.Height / GetDpiScaleX());
WebServer.Start();
}
public double GetDpiScaleX()
{
return VisualTreeHelper.GetDpi(this).DpiScaleX;
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
WebServer.Stop();
Environment.Exit(0);
}
}
}