76 lines
2.4 KiB
C#
76 lines
2.4 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using System.Threading.Tasks;
|
|
using Cvte.Composition;
|
|
using Cvte.EasiNote;
|
|
using BetterEN5.Services;
|
|
using BetterEN5.UI;
|
|
|
|
namespace BetterEN5
|
|
{
|
|
class Program : dotnetCampus.EasiPlugins.EasiPlugin
|
|
{
|
|
protected override Task OnRunningAsync()
|
|
{
|
|
if (!EN.CommandOptions.IsCloud)
|
|
{
|
|
if (EN.App.IsReady)
|
|
{
|
|
Run();
|
|
}
|
|
else
|
|
{
|
|
EN.App.Ready += App_Ready;
|
|
}
|
|
}
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
private void App_Ready(object? sender, EventArgs e)
|
|
{
|
|
EN.App.Ready -= App_Ready;
|
|
Run();
|
|
}
|
|
|
|
private async void Run()
|
|
{
|
|
await Task.Delay(TimeSpan.FromSeconds(3));
|
|
TouchFixService.ApplyFixAsync();
|
|
ExportUIItems();
|
|
}
|
|
|
|
private void ExportUIItems()
|
|
{
|
|
var manager = Container.Current.Get<IUIItemManager>();
|
|
|
|
manager.AppendWithLang(new ApplicationMenuSettings(),
|
|
new UIItemAttribute(new[] { "ApplicationMenu" }), new[]
|
|
{
|
|
new UIItemLangInfo(new CultureInfo("zh-CHS"), "Better-Seewo"),
|
|
new UIItemLangInfo(new CultureInfo("en"), "Better-Seewo"),
|
|
});
|
|
|
|
manager.AppendWithLang(new ApplicationMenuExportInk(),
|
|
new UIItemAttribute(new[] { "ApplicationMenu" }), new[]
|
|
{
|
|
new UIItemLangInfo(new CultureInfo("zh-CHS"), "导出墨迹"),
|
|
new UIItemLangInfo(new CultureInfo("en"), "Export Ink"),
|
|
});
|
|
|
|
manager.AppendWithLang(new HeadToolBarInkImport(),
|
|
new UIItemAttribute(new[] { "HeadToolBar" }), new[]
|
|
{
|
|
new UIItemLangInfo(new CultureInfo("zh-CHS"), "导入墨迹"),
|
|
new UIItemLangInfo(new CultureInfo("en"), "Import Ink"),
|
|
});
|
|
|
|
manager.AppendWithLang(new ExtendedTitleBarSettings(),
|
|
new UIItemAttribute(new[] { "ExtendedTitleBar" }), new[]
|
|
{
|
|
new UIItemLangInfo(new CultureInfo("zh-CHS"), "Better-Seewo"),
|
|
new UIItemLangInfo(new CultureInfo("en"), "Better-Seewo"),
|
|
});
|
|
}
|
|
}
|
|
}
|