improve:启动速度
This commit is contained in:
+22
-21
@@ -829,32 +829,11 @@ namespace Ink_Canvas
|
|||||||
SetSplashProgress(50);
|
SetSplashProgress(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 记录应用启动(设备标识符)
|
|
||||||
if (_isSplashScreenShown)
|
if (_isSplashScreenShown)
|
||||||
{
|
{
|
||||||
SetSplashMessage("正在加载配置...");
|
SetSplashMessage("正在加载配置...");
|
||||||
SetSplashProgress(60);
|
SetSplashProgress(60);
|
||||||
await Task.Delay(100);
|
|
||||||
}
|
}
|
||||||
DeviceIdentifier.RecordAppLaunch();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var systemVersion = DeviceIdentifier.GetSystemVersion();
|
|
||||||
if (!string.IsNullOrWhiteSpace(systemVersion))
|
|
||||||
{
|
|
||||||
SentrySdk.ConfigureScope(scope =>
|
|
||||||
{
|
|
||||||
scope.SetTag("system_version", systemVersion);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
LogHelper.WriteLogToFile($"App | 初始化系统版本遥测标签失败: {ex.Message}", LogHelper.LogType.Warning);
|
|
||||||
}
|
|
||||||
LogHelper.WriteLogToFile($"App | 设备ID: {DeviceIdentifier.GetDeviceId()}");
|
|
||||||
LogHelper.WriteLogToFile($"App | 使用频率: {DeviceIdentifier.GetUsageFrequency()}");
|
|
||||||
LogHelper.WriteLogToFile($"App | 更新优先级: {DeviceIdentifier.GetUpdatePriority()}");
|
|
||||||
|
|
||||||
// 处理更新模式启动
|
// 处理更新模式启动
|
||||||
bool isUpdateMode = AutoUpdateHelper.HandleUpdateModeStartup(e.Args);
|
bool isUpdateMode = AutoUpdateHelper.HandleUpdateModeStartup(e.Args);
|
||||||
@@ -1288,6 +1267,28 @@ namespace Ink_Canvas
|
|||||||
{
|
{
|
||||||
LogHelper.WriteLogToFile(string.Format("加载插件时出错: {0}", ex.Message), LogHelper.LogType.Error);
|
LogHelper.WriteLogToFile(string.Format("加载插件时出错: {0}", ex.Message), LogHelper.LogType.Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await Task.Delay(1500);
|
||||||
|
DeviceIdentifier.RecordAppLaunch();
|
||||||
|
var systemVersion = DeviceIdentifier.GetSystemVersion();
|
||||||
|
if (!string.IsNullOrWhiteSpace(systemVersion))
|
||||||
|
{
|
||||||
|
SentrySdk.ConfigureScope(scope =>
|
||||||
|
{
|
||||||
|
scope.SetTag("system_version", systemVersion);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
LogHelper.WriteLogToFile($"App | 设备ID: {DeviceIdentifier.GetDeviceId()}");
|
||||||
|
LogHelper.WriteLogToFile($"App | 使用频率: {DeviceIdentifier.GetUsageFrequency()}");
|
||||||
|
LogHelper.WriteLogToFile($"App | 更新优先级: {DeviceIdentifier.GetUpdatePriority()}");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogToFile($"App | 初始化设备统计与遥测标签失败: {ex.Message}", LogHelper.LogType.Warning);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -311,7 +311,10 @@ namespace Ink_Canvas
|
|||||||
// 应用无焦点模式设置
|
// 应用无焦点模式设置
|
||||||
ApplyNoFocusMode();
|
ApplyNoFocusMode();
|
||||||
// 应用窗口置顶设置
|
// 应用窗口置顶设置
|
||||||
ApplyAlwaysOnTop();
|
Dispatcher.BeginInvoke(new Action(() =>
|
||||||
|
{
|
||||||
|
ApplyAlwaysOnTop();
|
||||||
|
}), DispatcherPriority.ApplicationIdle);
|
||||||
|
|
||||||
// 添加窗口激活事件处理,确保置顶状态在窗口重新激活时得到保持
|
// 添加窗口激活事件处理,确保置顶状态在窗口重新激活时得到保持
|
||||||
Activated += Window_Activated;
|
Activated += Window_Activated;
|
||||||
@@ -1283,7 +1286,10 @@ namespace Ink_Canvas
|
|||||||
// 应用无焦点模式设置
|
// 应用无焦点模式设置
|
||||||
ApplyNoFocusMode();
|
ApplyNoFocusMode();
|
||||||
// 应用窗口置顶设置
|
// 应用窗口置顶设置
|
||||||
ApplyAlwaysOnTop();
|
Dispatcher.BeginInvoke(new Action(() =>
|
||||||
|
{
|
||||||
|
ApplyAlwaysOnTop();
|
||||||
|
}), DispatcherPriority.ApplicationIdle);
|
||||||
|
|
||||||
// 设置UIA置顶状态
|
// 设置UIA置顶状态
|
||||||
App.IsUIAccessTopMostEnabled = Settings.Advanced.EnableUIAccessTopMost;
|
App.IsUIAccessTopMostEnabled = Settings.Advanced.EnableUIAccessTopMost;
|
||||||
|
|||||||
Reference in New Issue
Block a user