mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Rename
This commit is contained in:
@@ -18,8 +18,8 @@ namespace Wox.Infrastructure.Image
|
||||
public static class ImageLoader
|
||||
{
|
||||
private static readonly ConcurrentDictionary<string, ImageSource> ImageSources = new ConcurrentDictionary<string, ImageSource>();
|
||||
private static readonly string DefaultIcon = Path.Combine(Wox.ProgramPath, "Images", "app.png");
|
||||
private static readonly string ErrorIcon = Path.Combine(Wox.ProgramPath, "Images", "app_error.png");
|
||||
private static readonly string DefaultIcon = Path.Combine(Constant.ProgramDirectory, "Images", "app.png");
|
||||
private static readonly string ErrorIcon = Path.Combine(Constant.ProgramDirectory, "Images", "app_error.png");
|
||||
|
||||
private static readonly string[] ImageExtions =
|
||||
{
|
||||
@@ -174,7 +174,7 @@ namespace Wox.Infrastructure.Image
|
||||
}
|
||||
else
|
||||
{
|
||||
var defaultDirectoryPath = Path.Combine(Wox.ProgramPath, "Images", Path.GetFileName(path));
|
||||
var defaultDirectoryPath = Path.Combine(Constant.ProgramDirectory, "Images", Path.GetFileName(path));
|
||||
if (File.Exists(defaultDirectoryPath))
|
||||
{
|
||||
image = new BitmapImage(new Uri(defaultDirectoryPath));
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Wox.Infrastructure.Logger
|
||||
static Log()
|
||||
{
|
||||
var directoryName = "Logs";
|
||||
var path = Path.Combine(Wox.DataPath, directoryName, Wox.Version);
|
||||
var path = Path.Combine(Constant.DataDirectory, directoryName, Constant.Version);
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
Directory.CreateDirectory(path);
|
||||
@@ -21,7 +21,7 @@ namespace Wox.Infrastructure.Logger
|
||||
var configuration = new LoggingConfiguration();
|
||||
var target = new FileTarget();
|
||||
configuration.AddTarget("file", target);
|
||||
target.FileName = "${specialfolder:folder=ApplicationData}/" + Wox.Name + "/" + directoryName + "/" + Wox.Version + "/${shortdate}.log";
|
||||
target.FileName = "${specialfolder:folder=ApplicationData}/" + Constant.Wox + "/" + directoryName + "/" + Constant.Version + "/${shortdate}.log";
|
||||
var rule = new LoggingRule("*", LogLevel.Info, target);
|
||||
configuration.LoggingRules.Add(rule);
|
||||
LogManager.Configuration = configuration;
|
||||
|
||||
@@ -15,8 +15,8 @@ namespace Wox.Infrastructure.Storage
|
||||
internal JsonStrorage()
|
||||
{
|
||||
FileSuffix = ".json";
|
||||
DirectoryName = Wox.Settings;
|
||||
DirectoryPath = Wox.SettingsPath;
|
||||
DirectoryName = Constant.Settings;
|
||||
DirectoryPath = Constant.SettingsPath;
|
||||
FilePath = Path.Combine(DirectoryPath, FileName + FileSuffix);
|
||||
|
||||
ValidateDirectory();
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
public PluginJsonStorage()
|
||||
{
|
||||
DirectoryName = Wox.Plugins;
|
||||
DirectoryName = Constant.Plugins;
|
||||
|
||||
// C# releated, add python releated below
|
||||
var assemblyName = DataType.Assembly.GetName().Name;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
DataType = typeof (T);
|
||||
FileName = DataType.Name;
|
||||
DirectoryPath = Wox.DataPath;
|
||||
DirectoryPath = Constant.DataDirectory;
|
||||
}
|
||||
|
||||
protected void ValidateDirectory()
|
||||
|
||||
@@ -5,18 +5,19 @@ using System.Reflection;
|
||||
|
||||
namespace Wox.Infrastructure
|
||||
{
|
||||
public static class Wox
|
||||
public static class Constant
|
||||
{
|
||||
public const string Name = "Wox";
|
||||
public const string Wox = "Wox";
|
||||
public const string Plugins = "Plugins";
|
||||
public const string Settings = "Settings";
|
||||
|
||||
private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
|
||||
public static readonly string ProgramPath = Directory.GetParent(Assembly.Location).ToString();
|
||||
public static readonly string DataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Name);
|
||||
public static readonly string UserDirectory = Path.Combine(DataPath, Plugins);
|
||||
public static readonly string PreinstalledDirectory = Path.Combine(ProgramPath, Plugins);
|
||||
public static readonly string SettingsPath = Path.Combine(DataPath, Settings);
|
||||
public static readonly string ProgramDirectory = Directory.GetParent(Assembly.Location).ToString();
|
||||
public static readonly string ExecutablePath = Path.Combine(ProgramDirectory, Wox + ".exe");
|
||||
public static readonly string DataDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Wox);
|
||||
public static readonly string UserDirectory = Path.Combine(DataDirectory, Plugins);
|
||||
public static readonly string PreinstalledDirectory = Path.Combine(ProgramDirectory, Plugins);
|
||||
public static readonly string SettingsPath = Path.Combine(DataDirectory, Settings);
|
||||
public const string Github = "https://github.com/Wox-launcher/Wox";
|
||||
public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location).ProductVersion;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user