improve:白板翻页性能
This commit is contained in:
@@ -163,7 +163,6 @@ namespace Ink_Canvas
|
||||
/// <remarks>
|
||||
/// - 根据参数设置当前提交类型
|
||||
/// - 清除画布上的所有墨迹
|
||||
/// - 执行轻量级内存清理
|
||||
/// - 恢复当前提交类型为用户输入
|
||||
/// </remarks>
|
||||
private void ClearStrokes(bool isErasedByCode)
|
||||
@@ -173,23 +172,9 @@ namespace Ink_Canvas
|
||||
|
||||
inkCanvas.Strokes.Clear();
|
||||
|
||||
// 执行内存清理
|
||||
PerformLightweightMemoryCleanup();
|
||||
|
||||
_currentCommitType = CommitReason.UserInput;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 执行内存清理
|
||||
/// </summary>
|
||||
private void PerformLightweightMemoryCleanup()
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
GC.Collect();
|
||||
});
|
||||
}
|
||||
|
||||
private static HashSet<UIElement> CollectRemovedElementsFromHistory(TimeMachineHistory[] history)
|
||||
{
|
||||
var set = new HashSet<UIElement>();
|
||||
|
||||
@@ -556,10 +556,12 @@ namespace Ink_Canvas
|
||||
|
||||
if (arg != "/F")
|
||||
{
|
||||
var p = new Process();
|
||||
p.StartInfo = new ProcessStartInfo("taskkill", arg);
|
||||
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
p.Start();
|
||||
using (var p = new Process())
|
||||
{
|
||||
p.StartInfo = new ProcessStartInfo("taskkill", arg);
|
||||
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
p.Start();
|
||||
}
|
||||
|
||||
if (arg.Contains("EasiNote"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user