2026-06-28 01:43:01 +08:00
|
|
|
using System;
|
2026-06-28 12:40:10 +08:00
|
|
|
using System.Collections.Generic;
|
2026-06-28 01:43:01 +08:00
|
|
|
using System.Globalization;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Cvte.Composition;
|
|
|
|
|
using Cvte.EasiNote;
|
2026-06-28 12:40:10 +08:00
|
|
|
using Cvte.Windows.Localization;
|
2026-06-28 01:43:01 +08:00
|
|
|
using BetterEN5.UI;
|
|
|
|
|
|
2026-06-28 12:40:10 +08:00
|
|
|
namespace BetterEN5;
|
|
|
|
|
|
|
|
|
|
class Program : dotnetCampus.EasiPlugins.EasiPlugin
|
2026-06-28 01:43:01 +08:00
|
|
|
{
|
2026-06-28 12:40:10 +08:00
|
|
|
protected override Task OnRunningAsync()
|
2026-06-28 01:43:01 +08:00
|
|
|
{
|
2026-06-28 12:40:10 +08:00
|
|
|
if (EN.CommandOptions.IsCloud)
|
2026-06-28 01:43:01 +08:00
|
|
|
{
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-28 12:40:10 +08:00
|
|
|
if (EN.App.IsReady)
|
2026-06-28 01:43:01 +08:00
|
|
|
{
|
|
|
|
|
Run();
|
|
|
|
|
}
|
2026-06-28 12:40:10 +08:00
|
|
|
else
|
2026-06-28 01:43:01 +08:00
|
|
|
{
|
2026-06-28 12:40:10 +08:00
|
|
|
EN.App.Ready += App_Ready;
|
2026-06-28 01:43:01 +08:00
|
|
|
}
|
|
|
|
|
|
2026-06-28 12:40:10 +08:00
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
2026-06-28 02:43:22 +08:00
|
|
|
|
2026-06-28 12:40:10 +08:00
|
|
|
private void App_Ready(object? sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
EN.App.Ready -= App_Ready;
|
|
|
|
|
Run();
|
|
|
|
|
}
|
2026-06-28 02:43:22 +08:00
|
|
|
|
2026-06-28 12:40:10 +08:00
|
|
|
private async void Run()
|
|
|
|
|
{
|
|
|
|
|
await Task.Delay(TimeSpan.FromSeconds(3));
|
|
|
|
|
ExportUIItems();
|
|
|
|
|
}
|
2026-06-28 11:12:26 +08:00
|
|
|
|
2026-06-28 12:40:10 +08:00
|
|
|
private void ExportUIItems()
|
|
|
|
|
{
|
|
|
|
|
var manager = Container.Current.Get<IUIItemManager>();
|
2026-06-28 02:43:22 +08:00
|
|
|
|
2026-06-28 12:40:10 +08:00
|
|
|
manager.Append(c => new ExportInkMenuItem(), new UIItemAttribute(UIItemPurposes.BoardEditMenu));
|
|
|
|
|
manager.Append(c => new ImportInkMenuItem(), new UIItemAttribute(UIItemPurposes.BoardEditMenu));
|
|
|
|
|
manager.Append(c => new ManagerMenuItem(), new UIItemAttribute(UIItemPurposes.BoardEditMenu));
|
2026-06-28 11:12:26 +08:00
|
|
|
|
2026-06-28 12:40:10 +08:00
|
|
|
_ = System.Windows.Application.Current.Dispatcher.InvokeAsync(() =>
|
2026-06-28 11:12:26 +08:00
|
|
|
{
|
2026-06-28 12:40:10 +08:00
|
|
|
Lang.Sources.Add(new DictionaryLanguageSource
|
|
|
|
|
{
|
|
|
|
|
[new CultureInfo("zh-CHS")] = new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
{ "Lang.BoardEditContextMenu.ExportInk", "导出墨迹" },
|
|
|
|
|
{ "Lang.BoardEditContextMenu.ImportInk", "导入墨迹" },
|
|
|
|
|
{ "Lang.BoardEditContextMenu.Manager", "Better-Seewo 管理" },
|
|
|
|
|
},
|
|
|
|
|
[new CultureInfo("en")] = new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
{ "Lang.BoardEditContextMenu.ExportInk", "Export Ink" },
|
|
|
|
|
{ "Lang.BoardEditContextMenu.ImportInk", "Import Ink" },
|
|
|
|
|
{ "Lang.BoardEditContextMenu.Manager", "Better-Seewo Manager" },
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
});
|
2026-06-28 01:43:01 +08:00
|
|
|
}
|
|
|
|
|
}
|