2014-12-15 22:58:49 +08:00
|
|
|
using System;
|
2016-01-07 05:34:42 +08:00
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
using System.Threading;
|
2014-08-10 22:22:54 +08:00
|
|
|
using Wox.Infrastructure;
|
|
|
|
|
2015-01-03 15:20:34 +08:00
|
|
|
namespace Wox.Plugin.Program
|
2014-08-10 22:22:54 +08:00
|
|
|
{
|
2014-12-15 22:58:49 +08:00
|
|
|
[Serializable]
|
2014-08-10 22:22:54 +08:00
|
|
|
public class Program
|
|
|
|
{
|
2016-01-07 05:34:42 +08:00
|
|
|
private static readonly Regex AbbrRegexp = new Regex("[^A-Z0-9]", RegexOptions.Compiled);
|
2014-08-10 22:22:54 +08:00
|
|
|
private string m_Title;
|
|
|
|
public string Title
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return m_Title;
|
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
|
|
|
m_Title = value;
|
|
|
|
string pinyin = m_Title.Unidecode();
|
|
|
|
PinyinTitle = pinyin;
|
2016-01-07 05:34:42 +08:00
|
|
|
AbbrTitle = AbbrRegexp.Replace(Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(pinyin), "");
|
2014-08-10 22:22:54 +08:00
|
|
|
if (AbbrTitle.Length < 2) AbbrTitle = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public string PinyinTitle { get; private set; }
|
|
|
|
public string AbbrTitle { get; private set; }
|
|
|
|
public string IcoPath { get; set; }
|
|
|
|
public string ExecutePath { get; set; }
|
|
|
|
public string ExecuteName { get; set; }
|
|
|
|
public int Score { get; set; }
|
|
|
|
public IProgramSource Source { get; set; }
|
|
|
|
}
|
|
|
|
}
|