Use existing Everything, dll is loaded by platform

fix #574
This commit is contained in:
bao-qian
2016-05-04 02:26:19 +01:00
parent 461e650e05
commit bc0f5a9136
21 changed files with 85 additions and 2783 deletions

View File

@@ -21,7 +21,7 @@ namespace Wox.Infrastructure.Image
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[] ImageExtions =
private static readonly string[] ImageExtions =
{
".png",
".jpg",
@@ -100,8 +100,12 @@ namespace Wox.Infrastructure.Image
}
public static void PreloadImages()
{
ImageSources[DefaultIcon] = new BitmapImage(new Uri(DefaultIcon));
ImageSources[ErrorIcon] = new BitmapImage(new Uri(ErrorIcon));
foreach (var icon in new[] { DefaultIcon, ErrorIcon })
{
ImageSource img = new BitmapImage(new Uri(DefaultIcon));
img.Freeze();
ImageSources[icon] = img;
}
Task.Factory.StartNew(() =>
{
Stopwatch.Debug("Preload images from cache", () =>

View File

@@ -6,7 +6,7 @@ namespace Wox.Infrastructure.Storage
{
public PluginJsonStorage()
{
DirectoryName = "Plugins";
DirectoryName = Wox.Plugins;
// C# releated, add python releated below
var assemblyName = DataType.Assembly.GetName().Name;

View File

@@ -7,7 +7,10 @@ namespace Wox.Infrastructure
public static class Wox
{
public const string Name = "Wox";
public const string Plugins = "Plugins";
public static readonly string ProgramPath = Directory.GetParent(Assembly.GetExecutingAssembly().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);
}
}