完善了双指缩放,优化了截图

This commit is contained in:
snltty
2023-10-25 16:43:22 +08:00
parent 04cf6a1f97
commit 570ab3e60f
32 changed files with 628 additions and 358 deletions

View File

@@ -1,4 +1,5 @@
using common.libs.database;
using cmonitor.hijack;
using common.libs.database;
using System;
using System.ComponentModel.DataAnnotations.Schema;
@@ -14,15 +15,87 @@ namespace cmonitor.server.client
{
this.configDataProvider = configDataProvider;
ClientConfig config = configDataProvider.Load().Result ?? new ClientConfig();
Lock = config.Lock;
LLock = config.LLock;
Wallpaper = config.Wallpaper;
Usb = config.Usb;
Save();
WallpaperUrl = config.WallpaperUrl;
HijackConfig = config.HijackConfig;
WindowNames = config.WindowNames;
SaveTask();
}
private void SaveTask()
{
Task.Factory.StartNew(() =>
{
while (true)
{
try
{
if (updated)
{
Save();
}
}
catch (Exception)
{
}
System.Threading.Thread.Sleep(5000);
}
}, TaskCreationOptions.LongRunning);
}
private bool updated = false;
private bool _llock;
public bool LLock
{
get => _llock; set
{
_llock = value;
updated = true;
}
}
private bool _wallpaper;
public bool Wallpaper
{
get => _wallpaper; set
{
_wallpaper = value;
updated = true;
}
}
private string _wallpaperUrl;
public string WallpaperUrl
{
get => _wallpaperUrl; set
{
_wallpaperUrl = value;
updated = true;
}
}
private HijackConfig _hijackConfig = new HijackConfig();
public HijackConfig HijackConfig
{
get => _hijackConfig; set
{
_hijackConfig = value;
updated = true;
}
}
private string[] _windowNames = Array.Empty<string>();
public string[] WindowNames
{
get => _windowNames; set
{
_windowNames = value;
updated = true;
}
}
public bool Lock { get; set; }
public bool Wallpaper { get; set; }
public bool Usb { get; set; }
public void Save()
{