mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
Refactoring pinyin
1. use custom patched pinyin library Pinyin4Net 2. fix memory leak on startup: 360mb -> 160mb when using vs15 debugger
This commit is contained in:
@@ -9,24 +9,7 @@ namespace Wox.Plugin.Program
|
||||
public class Program
|
||||
{
|
||||
private static readonly Regex AbbrRegexp = new Regex("[^A-Z0-9]", RegexOptions.Compiled);
|
||||
private string m_Title;
|
||||
public string Title
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Title;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Title = value;
|
||||
string pinyin = m_Title.Unidecode();
|
||||
PinyinTitle = pinyin;
|
||||
AbbrTitle = AbbrRegexp.Replace(Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(pinyin), "");
|
||||
if (AbbrTitle.Length < 2) AbbrTitle = null;
|
||||
}
|
||||
}
|
||||
public string PinyinTitle { get; private set; }
|
||||
public string AbbrTitle { get; private set; }
|
||||
public string Title { get; set; }
|
||||
public string IcoPath { get; set; }
|
||||
public string ExecutePath { get; set; }
|
||||
public string ExecuteName { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user