Refactoring Refactoring icon, part 2

1. Add baidu, fix #576, #582
2. Refactoring
This commit is contained in:
bao-qian
2016-05-03 21:18:26 +01:00
parent 730864609f
commit 174c7a776e
21 changed files with 216 additions and 230 deletions

View File

@@ -7,21 +7,24 @@ namespace Wox.Plugin
public class Result
{
private string _pluginDirectory;
private string _icoPath;
public string Title { get; set; }
public string SubTitle { get; set; }
public string IcoPath { get; set; }
public string FullIcoPath
public string IcoPath
{
get
get { return _icoPath; }
set
{
if (string.IsNullOrEmpty(IcoPath)) return string.Empty;
if (IcoPath.StartsWith("data:"))
if (!string.IsNullOrEmpty(PluginDirectory) && !Path.IsPathRooted(value))
{
return IcoPath;
_icoPath = Path.Combine(value, IcoPath);
}
else
{
_icoPath = value;
}
return Path.Combine(PluginDirectory, IcoPath);
}
}
@@ -40,7 +43,18 @@ namespace Wox.Plugin
/// <summary>
/// Plugin directory
/// </summary>
public string PluginDirectory { get; set; }
public string PluginDirectory
{
get { return _pluginDirectory; }
set
{
_pluginDirectory = value;
if (!string.IsNullOrEmpty(IcoPath) && Path.IsPathRooted(IcoPath))
{
IcoPath = Path.Combine(value, IcoPath);
}
}
}
public override bool Equals(object obj)
{