v1.2.0: 重构为插件+独立Manager架构,横版UI,精确保留文本框边距的文档转换
This commit is contained in:
30
Better-EN5/UI/BoardMenuImportInk.cs
Normal file
30
Better-EN5/UI/BoardMenuImportInk.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Microsoft.Win32;
|
||||
using Cvte.EasiNote;
|
||||
using Cvte.Windows.Input;
|
||||
using BetterEN5.Services;
|
||||
|
||||
namespace BetterEN5.UI
|
||||
{
|
||||
public class BoardMenuImportInk : BoardEditMenuItem
|
||||
{
|
||||
public BoardMenuImportInk()
|
||||
{
|
||||
SortHint = 997;
|
||||
Command = new DelegateCommand(() =>
|
||||
{
|
||||
var dialog = new OpenFileDialog
|
||||
{
|
||||
Title = "导入墨迹",
|
||||
Filter = "墨迹文件 (*.ink.json)|*.ink.json|JSON 文件 (*.json)|*.json",
|
||||
DefaultExt = ".ink.json"
|
||||
};
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
var inkService = new InkService();
|
||||
_ = inkService.ImportInkAsync(dialog.FileName);
|
||||
}
|
||||
});
|
||||
Predicate = _ => true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user