using System; using System.Globalization; using System.Threading.Tasks; using System.Windows; 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(); manager.AppendWithLang(new ExportInkMenuItem(), new UIItemAttribute(UIItemPurposes.BoardEditMenu), new[] { new UIItemLangInfo(new CultureInfo("zh-CHS"), "导出墨迹"), new UIItemLangInfo(new CultureInfo("en"), "Export Ink"), }); manager.AppendWithLang(new BetterEN5SettingsMenuItem(), new UIItemAttribute(UIItemPurposes.BoardEditMenu), new[] { new UIItemLangInfo(new CultureInfo("zh-CHS"), "Better-Seewo 设置"), new UIItemLangInfo(new CultureInfo("en"), "Better-Seewo Settings"), }); } } }