Refactoring directory path for plugins

This commit is contained in:
bao-qian 2016-01-08 02:18:19 +00:00
parent 6071319acd
commit a0f556b2a9
23 changed files with 41 additions and 38 deletions

View File

@ -3,10 +3,10 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using WindowsInput;
using WindowsInput.Native;
using Wox.Infrastructure;
using Wox.Infrastructure.Hotkey;
using Wox.Infrastructure.Logger;
using Control = System.Windows.Controls.Control;
@ -202,7 +202,7 @@ namespace Wox.Plugin.CMD
public string GetLanguagesFolder()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
return Path.Combine(WoxDirectroy.Executable, "Languages");
}
public string GetTranslatedPluginTitle()

View File

@ -1,6 +1,4 @@
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Newtonsoft.Json;
using Wox.Infrastructure.Storage;

View File

@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Windows;
using Wox.Infrastructure;
using YAMP;
namespace Wox.Plugin.Caculator
@ -95,7 +95,8 @@ namespace Wox.Plugin.Caculator
public string GetLanguagesFolder()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
return Path.Combine(WoxDirectroy.Executable, "Languages");
}
public string GetTranslatedPluginTitle()

View File

@ -57,6 +57,10 @@
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
<Project>{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}</Project>
<Name>Wox.Infrastructure</Name>
</ProjectReference>
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
<Name>Wox.Plugin</Name>

View File

@ -4,8 +4,8 @@ using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows;
using Wox.Infrastructure;
namespace Wox.Plugin.Color
{
@ -111,7 +111,7 @@ namespace Wox.Plugin.Color
public string GetLanguagesFolder()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
return Path.Combine(WoxDirectroy.Executable, "Languages");
}
public string GetTranslatedPluginTitle()

View File

@ -55,6 +55,10 @@
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
<Project>{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}</Project>
<Name>Wox.Infrastructure</Name>
</ProjectReference>
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
<Name>Wox.Plugin</Name>

View File

@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using Wox.Infrastructure;
namespace Wox.Plugin.ControlPanel
@ -85,7 +84,7 @@ namespace Wox.Plugin.ControlPanel
public string GetLanguagesFolder()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
return Path.Combine(WoxDirectroy.Executable, "Languages");
}
public string GetTranslatedPluginTitle()

View File

@ -1,6 +1,4 @@
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Wox.Infrastructure.Storage;
using JsonProperty = Newtonsoft.Json.JsonPropertyAttribute;

View File

@ -3,10 +3,10 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.ServiceProcess;
using System.Windows;
using Wox.Infrastructure;
using Wox.Plugin.Everything.Everything;
namespace Wox.Plugin.Everything
@ -258,7 +258,7 @@ namespace Wox.Plugin.Everything
public string GetLanguagesFolder()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
return Path.Combine(WoxDirectroy.Executable, "Languages");
}
public string GetTranslatedPluginTitle()

View File

@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using Wox.Infrastructure;
namespace Wox.Plugin.Folder
{
@ -246,7 +246,7 @@ namespace Wox.Plugin.Folder
public string GetLanguagesFolder()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
return Path.Combine(WoxDirectroy.Executable, "Languages");
}
public string GetTranslatedPluginTitle()

View File

@ -1,6 +1,4 @@
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Newtonsoft.Json;
using Wox.Infrastructure.Storage;

View File

@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Wox.Core.Plugin;
using Wox.Core.UserSettings;
using Wox.Infrastructure;
namespace Wox.Plugin.PluginIndicator
{
@ -41,7 +41,7 @@ namespace Wox.Plugin.PluginIndicator
public string GetLanguagesFolder()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
return Path.Combine(WoxDirectroy.Executable, "Languages");
}
public string GetTranslatedPluginTitle()

View File

@ -3,11 +3,11 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Windows;
using Newtonsoft.Json;
using Wox.Infrastructure;
namespace Wox.Plugin.PluginManagement
{
@ -244,7 +244,7 @@ namespace Wox.Plugin.PluginManagement
public string GetLanguagesFolder()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
return Path.Combine(WoxDirectroy.Executable, "Languages");
}
public string GetTranslatedPluginTitle()

View File

@ -55,6 +55,10 @@
<Compile Include="WoxPluginResult.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
<Project>{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}</Project>
<Name>Wox.Infrastructure</Name>
</ProjectReference>
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
<Name>Wox.Plugin</Name>

View File

@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Wox.Infrastructure.Storage;
namespace Wox.Plugin.Program

View File

@ -1,7 +1,5 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Reflection;
using Newtonsoft.Json;
using Wox.Infrastructure.Storage;

View File

@ -177,7 +177,7 @@ namespace Wox.Plugin.Program
public string GetLanguagesFolder()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
return Path.Combine(WoxDirectroy.Executable, "Languages");
}
public string GetTranslatedPluginTitle()
{

View File

@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Forms;
@ -193,7 +192,7 @@ namespace Wox.Plugin.Sys
public string GetLanguagesFolder()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
return Path.Combine(WoxDirectroy.Executable, "Languages");
}
public string GetTranslatedPluginTitle()

View File

@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Text.RegularExpressions;
using Wox.Infrastructure;
namespace Wox.Plugin.Url
{
@ -105,7 +105,7 @@ namespace Wox.Plugin.Url
public string GetLanguagesFolder()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
return Path.Combine(WoxDirectroy.Executable, "Languages");
}
public string GetTranslatedPluginTitle()

View File

@ -49,6 +49,10 @@
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
<Project>{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}</Project>
<Name>Wox.Infrastructure</Name>
</ProjectReference>
<ProjectReference Include="..\..\Wox.Plugin\Wox.Plugin.csproj">
<Project>{8451ecdd-2ea4-4966-bb0a-7bbc40138e80}</Project>
<Name>Wox.Plugin</Name>

View File

@ -3,8 +3,8 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows.Controls;
using Wox.Infrastructure;
using Wox.Plugin.WebSearch.Annotations;
using Wox.Plugin.WebSearch.SuggestionSources;
@ -92,7 +92,7 @@ namespace Wox.Plugin.WebSearch
public string GetLanguagesFolder()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
return Path.Combine(WoxDirectroy.Executable, "Languages");
}
public string GetTranslatedPluginTitle()

View File

@ -1,10 +1,10 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows;
using System.Windows.Media.Imaging;
using Microsoft.Win32;
using Wox.Infrastructure;
using Wox.Infrastructure.Exception;
namespace Wox.Plugin.WebSearch
@ -12,7 +12,7 @@ namespace Wox.Plugin.WebSearch
public partial class WebSearchSetting : Window
{
private const string _imageDirectoryName = "Images";
private string _pluginDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
private string _pluginDirectory = WoxDirectroy.Executable;
private readonly WebSearchesSetting _settingWindow;
private bool _isUpdate;
private WebSearch _updateWebSearch;
@ -130,7 +130,7 @@ namespace Wox.Plugin.WebSearch
if (!Directory.Exists(_pluginDirectory))
{
_pluginDirectory =
Path.GetDirectoryName(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
Path.GetDirectoryName(WoxDirectroy.Executable);
}
var dlg = new OpenFileDialog

View File

@ -1,6 +1,4 @@
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Newtonsoft.Json;
using Wox.Infrastructure.Storage;