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

@@ -6,6 +6,7 @@ namespace Wox.Plugin
{
public class PluginMetadata
{
private string _pluginDirectory;
public string ID { get; set; }
public string Name { get; set; }
public string Author { get; set; }
@@ -15,39 +16,34 @@ namespace Wox.Plugin
public string Website { get; set; }
public string ExecuteFilePath => Path.Combine(PluginDirectory, ExecuteFileName);
public string ExecuteFilePath { get; private set;}
public string ExecuteFileName { get; set; }
public string PluginDirectory { get; set; }
public string PluginDirectory
{
get { return _pluginDirectory; }
internal set
{
_pluginDirectory = value;
ExecuteFilePath = Path.Combine(value, ExecuteFileName);
IcoPath = Path.Combine(value, IcoPath);
}
}
[Obsolete("Use ActionKeywords instead, because Wox now support multiple action keywords. This will be remove in v1.3.0")]
public string ActionKeyword { get; set; }
public List<string> ActionKeywords { get; set; }
public string IcoPath { get; set; }
public string IcoPath { get; set;}
public override string ToString()
{
return Name;
}
public string FullIcoPath
{
get
{
// Return the default icon if IcoPath is empty
if (string.IsNullOrEmpty(IcoPath))
return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Images\\work.png");
if (IcoPath.StartsWith("data:"))
{
return IcoPath;
}
return Path.Combine(PluginDirectory, IcoPath);
}
}
[Obsolete("Use IcoPath")]
public string FullIcoPath => IcoPath;
}
}