mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
Refactoring Refactoring icon, part 2
1. Add baidu, fix #576, #582 2. Refactoring
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user