add:新设置
This commit is contained in:
@@ -71,7 +71,7 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
{
|
||||
var copyright = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyCopyrightAttribute>();
|
||||
if (copyright != null && !string.IsNullOrEmpty(copyright.Copyright))
|
||||
{
|
||||
{
|
||||
var copyrightText = copyright.Copyright;
|
||||
AboutCopyright.Text = copyrightText;
|
||||
AboutBottomCopyright.Text = copyrightText.Replace("Copyright ©", "© Copyright") + " 所有";
|
||||
@@ -97,13 +97,13 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
var bt = File.GetCreationTime(filePath);
|
||||
var m = bt.Month.ToString().PadLeft(2, '0');
|
||||
var d = bt.Day.ToString().PadLeft(2, '0');
|
||||
var h = bt.Hour.ToString().PadLeft(2, '0');
|
||||
var min = bt.Minute.ToString().PadLeft(2, '0');
|
||||
var s = bt.Second.ToString().PadLeft(2, '0');
|
||||
var m = bt.Month.ToString().PadLeft(2, '0');
|
||||
var d = bt.Day.ToString().PadLeft(2, '0');
|
||||
var h = bt.Hour.ToString().PadLeft(2, '0');
|
||||
var min = bt.Minute.ToString().PadLeft(2, '0');
|
||||
var s = bt.Second.ToString().PadLeft(2, '0');
|
||||
AboutBuildTime.Text = $"{bt.Year}-{m}-{d} {h}:{min}:{s}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AboutBuildTime.Text = "获取失败";
|
||||
@@ -122,7 +122,7 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
try
|
||||
{
|
||||
var support = TouchTabletDetectHelper.IsTouchEnabled();
|
||||
var touchcount = TouchTabletDetectHelper.GetTouchTabletDevices().Count;
|
||||
var touchcount = TouchTabletDetectHelper.GetTouchTabletDevices().Count;
|
||||
|
||||
Dispatcher.BeginInvoke(() =>
|
||||
{
|
||||
@@ -145,7 +145,7 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Dispatcher.BeginInvoke(() =>
|
||||
Dispatcher.BeginInvoke(() =>
|
||||
AboutTouchTabletText.Text = "检测失败");
|
||||
System.Diagnostics.Debug.WriteLine($"检测触摸设备失败: {ex.Message}");
|
||||
}
|
||||
@@ -208,12 +208,12 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
|
||||
try
|
||||
{
|
||||
ManagementObjectCollection collection;
|
||||
using (var searcher = new ManagementObjectSearcher(@"Select * From Win32_PnPEntity"))
|
||||
collection = searcher.Get();
|
||||
ManagementObjectCollection collection;
|
||||
using (var searcher = new ManagementObjectSearcher(@"Select * From Win32_PnPEntity"))
|
||||
collection = searcher.Get();
|
||||
|
||||
foreach (var device in collection)
|
||||
{
|
||||
foreach (var device in collection)
|
||||
{
|
||||
try
|
||||
{
|
||||
var name = device.GetPropertyValue("Name")?.ToString() ?? "";
|
||||
@@ -231,7 +231,7 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
descLower.Contains("touch") ||
|
||||
descLower.Contains("digitizer"))
|
||||
{
|
||||
devices.Add(new USBDeviceInfo(
|
||||
devices.Add(new USBDeviceInfo(
|
||||
device.GetPropertyValue("DeviceID")?.ToString() ?? "",
|
||||
device.GetPropertyValue("PNPDeviceID")?.ToString() ?? "",
|
||||
description
|
||||
@@ -242,9 +242,9 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
collection.Dispose();
|
||||
collection.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -271,10 +271,10 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
public static DateTimeOffset? GetBuildDateTime(Assembly assembly)
|
||||
{
|
||||
try
|
||||
{
|
||||
var path = assembly.Location;
|
||||
{
|
||||
var path = assembly.Location;
|
||||
if (string.IsNullOrEmpty(path) || !File.Exists(path))
|
||||
{
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -298,18 +298,18 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
fileStream.Read(fileHeader, 0, fileHeader.Length);
|
||||
|
||||
var pinnedBuffer = GCHandle.Alloc(fileHeader, GCHandleType.Pinned);
|
||||
try
|
||||
{
|
||||
var coffHeader = (_IMAGE_FILE_HEADER)Marshal.PtrToStructure(pinnedBuffer.AddrOfPinnedObject(), typeof(_IMAGE_FILE_HEADER));
|
||||
try
|
||||
{
|
||||
var coffHeader = (_IMAGE_FILE_HEADER)Marshal.PtrToStructure(pinnedBuffer.AddrOfPinnedObject(), typeof(_IMAGE_FILE_HEADER));
|
||||
var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
var buildTime = epoch.AddSeconds(coffHeader.TimeDateStamp);
|
||||
return new DateTimeOffset(buildTime.ToLocalTime());
|
||||
}
|
||||
finally
|
||||
{
|
||||
pinnedBuffer.Free();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
pinnedBuffer.Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -461,7 +461,7 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
System.Diagnostics.Debug.WriteLine($"打开贡献者名单失败: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 应用主题
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user