mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Refactoring.
This commit is contained in:
@@ -24,17 +24,31 @@ namespace Wox.Core.Plugin
|
||||
/// </summary>
|
||||
private static List<string> pluginDirectories = new List<string>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Default plugin directory
|
||||
/// new plugin will be installed to this directory
|
||||
/// </summary>
|
||||
public static string DefaultPluginDirectory
|
||||
{
|
||||
get
|
||||
{
|
||||
string userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE");
|
||||
if (userProfilePath != null)
|
||||
{
|
||||
return Path.Combine(Path.Combine(userProfilePath, ".Wox"), "Plugins");
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
static PluginManager()
|
||||
{
|
||||
pluginDirectories.Add(DefaultPluginDirectory);
|
||||
pluginDirectories.Add(
|
||||
Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Plugins"));
|
||||
|
||||
string userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE");
|
||||
if (userProfilePath != null)
|
||||
{
|
||||
pluginDirectories.Add(Path.Combine(Path.Combine(userProfilePath, ".Wox"), "Plugins"));
|
||||
}
|
||||
|
||||
MakesurePluginDirectoriesExist();
|
||||
}
|
||||
|
||||
@@ -73,6 +87,11 @@ namespace Wox.Core.Plugin
|
||||
}
|
||||
}
|
||||
|
||||
public static void InstallPlugin(string path)
|
||||
{
|
||||
PluginInstaller.Install(path);
|
||||
}
|
||||
|
||||
public static void Query(Query query)
|
||||
{
|
||||
QueryDispatcher.QueryDispatcher.Dispatch(query);
|
||||
|
||||
Reference in New Issue
Block a user