private static void preloadPrograms() { Logger.StopWatchNormal("Preload programs cost", () => { _win32Storage = new BinaryStorage <Win32[]>("Win32"); _win32s = _win32Storage.TryLoad(new Win32[] { }); _uwpStorage = new BinaryStorage <UWP.Application[]>("UWP"); _uwps = _uwpStorage.TryLoad(new UWP.Application[] { }); }); Logger.WoxInfo($"Number of preload win32 programs <{_win32s.Length}>"); Logger.WoxInfo($"Number of preload uwps <{_uwps.Length}>"); }
private void InitializePinyinHelpers() { Format.setToneType(HanyuPinyinToneType.WITHOUT_TONE); Logger.StopWatchNormal("Preload pinyin cache", () => { _pinyinStorage = new BinaryStorage <ConcurrentDictionary <string, string[][]> >("Pinyin"); PinyinCache = _pinyinStorage.TryLoad(new ConcurrentDictionary <string, string[][]>()); // force pinyin library static constructor initialize PinyinHelper.toHanyuPinyinStringArray('T', Format); }); Logger.WoxInfo($"Number of preload pinyin combination<{PinyinCache.Count}>"); }