From ec40956721befe41301bced7ed337c8259d1f52b Mon Sep 17 00:00:00 2001 From: bao-qian Date: Thu, 7 Jan 2016 20:04:37 +0000 Subject: [PATCH] Merge language and theme into resource folder --- Wox.Core/Plugin/PluginManager.cs | 3 +-- Wox.Core/{i18n => Resource}/AvailableLanguages.cs | 2 +- Wox.Core/{Theme => Resource}/FontHelper.cs | 2 +- .../{i18n => Resource}/Internationalization.cs | 3 +-- .../InternationalizationManager.cs | 2 +- Wox.Core/{i18n => Resource}/Language.cs | 2 +- Wox.Core/Resource/Resource.cs | 2 +- Wox.Core/Resource/ResourceMerger.cs | 5 ++--- Wox.Core/{Theme => Resource}/Theme.cs | 4 +--- Wox.Core/{Theme => Resource}/ThemeManager.cs | 2 +- Wox.Core/Updater/UpdaterManager.cs | 2 +- Wox.Core/Wox.Core.csproj | 14 +++++++------- Wox.CrashReporter/ReportWindow.xaml.cs | 2 +- Wox/ActionKeywords.xaml.cs | 2 +- Wox/CustomQueryHotkeySetting.xaml.cs | 2 +- Wox/HotkeyControl.xaml.cs | 2 +- Wox/MainWindow.xaml.cs | 3 +-- Wox/SettingWindow.xaml.cs | 3 +-- Wox/WoxUpdate.xaml.cs | 2 +- 19 files changed, 26 insertions(+), 33 deletions(-) rename Wox.Core/{i18n => Resource}/AvailableLanguages.cs (96%) rename Wox.Core/{Theme => Resource}/FontHelper.cs (98%) rename Wox.Core/{i18n => Resource}/Internationalization.cs (99%) rename Wox.Core/{i18n => Resource}/InternationalizationManager.cs (95%) rename Wox.Core/{i18n => Resource}/Language.cs (91%) rename Wox.Core/{Theme => Resource}/Theme.cs (99%) rename Wox.Core/{Theme => Resource}/ThemeManager.cs (94%) diff --git a/Wox.Core/Plugin/PluginManager.cs b/Wox.Core/Plugin/PluginManager.cs index 5bcabee4f..7ccdc60a6 100644 --- a/Wox.Core/Plugin/PluginManager.cs +++ b/Wox.Core/Plugin/PluginManager.cs @@ -4,8 +4,7 @@ using System.IO; using System.Linq; using System.Reflection; using System.Threading; -using Wox.Core.i18n; -using Wox.Core.UI; +using Wox.Core.Resource; using Wox.Core.UserSettings; using Wox.Infrastructure; using Wox.Infrastructure.Exception; diff --git a/Wox.Core/i18n/AvailableLanguages.cs b/Wox.Core/Resource/AvailableLanguages.cs similarity index 96% rename from Wox.Core/i18n/AvailableLanguages.cs rename to Wox.Core/Resource/AvailableLanguages.cs index b0d41c414..7b6231c86 100644 --- a/Wox.Core/i18n/AvailableLanguages.cs +++ b/Wox.Core/Resource/AvailableLanguages.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Wox.Core.i18n +namespace Wox.Core.Resource { internal static class AvailableLanguages { diff --git a/Wox.Core/Theme/FontHelper.cs b/Wox.Core/Resource/FontHelper.cs similarity index 98% rename from Wox.Core/Theme/FontHelper.cs rename to Wox.Core/Resource/FontHelper.cs index 8aca0b436..c7cc54bf6 100644 --- a/Wox.Core/Theme/FontHelper.cs +++ b/Wox.Core/Resource/FontHelper.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Windows; using System.Windows.Media; -namespace Wox.Core.Theme +namespace Wox.Core.Resource { public static class FontHelper { diff --git a/Wox.Core/i18n/Internationalization.cs b/Wox.Core/Resource/Internationalization.cs similarity index 99% rename from Wox.Core/i18n/Internationalization.cs rename to Wox.Core/Resource/Internationalization.cs index fe19a3343..14aad3c1f 100644 --- a/Wox.Core/i18n/Internationalization.cs +++ b/Wox.Core/Resource/Internationalization.cs @@ -3,13 +3,12 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Windows; -using Wox.Core.UI; using Wox.Core.UserSettings; using Wox.Infrastructure.Exception; using Wox.Infrastructure.Logger; using Wox.Plugin; -namespace Wox.Core.i18n +namespace Wox.Core.Resource { public class Internationalization : Resource { diff --git a/Wox.Core/i18n/InternationalizationManager.cs b/Wox.Core/Resource/InternationalizationManager.cs similarity index 95% rename from Wox.Core/i18n/InternationalizationManager.cs rename to Wox.Core/Resource/InternationalizationManager.cs index 999ae9e32..ffc2c2ecf 100644 --- a/Wox.Core/i18n/InternationalizationManager.cs +++ b/Wox.Core/Resource/InternationalizationManager.cs @@ -1,4 +1,4 @@ -namespace Wox.Core.i18n +namespace Wox.Core.Resource { public static class InternationalizationManager { diff --git a/Wox.Core/i18n/Language.cs b/Wox.Core/Resource/Language.cs similarity index 91% rename from Wox.Core/i18n/Language.cs rename to Wox.Core/Resource/Language.cs index 6caefeedd..c0bdc1ccb 100644 --- a/Wox.Core/i18n/Language.cs +++ b/Wox.Core/Resource/Language.cs @@ -1,4 +1,4 @@ -namespace Wox.Core.i18n +namespace Wox.Core.Resource { public class Language { diff --git a/Wox.Core/Resource/Resource.cs b/Wox.Core/Resource/Resource.cs index 3c03994e7..9ac7f2889 100644 --- a/Wox.Core/Resource/Resource.cs +++ b/Wox.Core/Resource/Resource.cs @@ -2,7 +2,7 @@ using System.Windows; using Wox.Infrastructure; -namespace Wox.Core.UI +namespace Wox.Core.Resource { public abstract class Resource { diff --git a/Wox.Core/Resource/ResourceMerger.cs b/Wox.Core/Resource/ResourceMerger.cs index 255314e62..61f3485ae 100644 --- a/Wox.Core/Resource/ResourceMerger.cs +++ b/Wox.Core/Resource/ResourceMerger.cs @@ -2,11 +2,10 @@ using System.IO; using System.Linq; using System.Windows; -using Wox.Core.i18n; using Wox.Core.Plugin; using Wox.Plugin; -namespace Wox.Core.UI +namespace Wox.Core.Resource { public static class ResourceMerger { @@ -25,7 +24,7 @@ namespace Wox.Core.UI } } - public static void UpdateResource(T t) where T : Resource + public static void UpdateResource(T t) where T : Core.Resource.Resource { RemoveResource(t.DirectoryName); Application.Current.Resources.MergedDictionaries.Add(t.GetResourceDictionary()); diff --git a/Wox.Core/Theme/Theme.cs b/Wox.Core/Resource/Theme.cs similarity index 99% rename from Wox.Core/Theme/Theme.cs rename to Wox.Core/Resource/Theme.cs index 28c32c90c..983b7ca55 100644 --- a/Wox.Core/Theme/Theme.cs +++ b/Wox.Core/Resource/Theme.cs @@ -2,17 +2,15 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Reflection; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Controls; using System.Windows.Interop; using System.Windows.Media; -using Wox.Core.UI; using Wox.Core.UserSettings; using Wox.Infrastructure.Logger; -namespace Wox.Core.Theme +namespace Wox.Core.Resource { public class Theme : Resource { diff --git a/Wox.Core/Theme/ThemeManager.cs b/Wox.Core/Resource/ThemeManager.cs similarity index 94% rename from Wox.Core/Theme/ThemeManager.cs rename to Wox.Core/Resource/ThemeManager.cs index 3ad8a0d7d..ef1414757 100644 --- a/Wox.Core/Theme/ThemeManager.cs +++ b/Wox.Core/Resource/ThemeManager.cs @@ -1,4 +1,4 @@ -namespace Wox.Core.Theme +namespace Wox.Core.Resource { public class ThemeManager { diff --git a/Wox.Core/Updater/UpdaterManager.cs b/Wox.Core/Updater/UpdaterManager.cs index 9b15e1008..9101332d5 100644 --- a/Wox.Core/Updater/UpdaterManager.cs +++ b/Wox.Core/Updater/UpdaterManager.cs @@ -8,7 +8,7 @@ using NAppUpdate.Framework.Common; using NAppUpdate.Framework.Sources; using NAppUpdate.Framework.Tasks; using Newtonsoft.Json; -using Wox.Core.i18n; +using Wox.Core.Resource; using Wox.Core.UserSettings; using Wox.Infrastructure.Http; using Wox.Infrastructure.Logger; diff --git a/Wox.Core/Wox.Core.csproj b/Wox.Core/Wox.Core.csproj index e4f1687c7..e1e6bdfd7 100644 --- a/Wox.Core/Wox.Core.csproj +++ b/Wox.Core/Wox.Core.csproj @@ -65,11 +65,11 @@ - - - - - + + + + + @@ -82,8 +82,8 @@ - - + + diff --git a/Wox.CrashReporter/ReportWindow.xaml.cs b/Wox.CrashReporter/ReportWindow.xaml.cs index f31585e2f..2ba0be099 100644 --- a/Wox.CrashReporter/ReportWindow.xaml.cs +++ b/Wox.CrashReporter/ReportWindow.xaml.cs @@ -3,7 +3,7 @@ using System.Threading; using System.Windows; using System.Windows.Documents; using Exceptionless; -using Wox.Core.i18n; +using Wox.Core.Resource; using Wox.Core.Updater; namespace Wox.CrashReporter diff --git a/Wox/ActionKeywords.xaml.cs b/Wox/ActionKeywords.xaml.cs index 46868ebbc..aa718ffd1 100644 --- a/Wox/ActionKeywords.xaml.cs +++ b/Wox/ActionKeywords.xaml.cs @@ -1,6 +1,6 @@ using System.Windows; -using Wox.Core.i18n; using Wox.Core.Plugin; +using Wox.Core.Resource; using Wox.Core.UserSettings; using Wox.Infrastructure.Exception; using Wox.Plugin; diff --git a/Wox/CustomQueryHotkeySetting.xaml.cs b/Wox/CustomQueryHotkeySetting.xaml.cs index 8cf21b62d..7c58babe1 100644 --- a/Wox/CustomQueryHotkeySetting.xaml.cs +++ b/Wox/CustomQueryHotkeySetting.xaml.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; using System.Windows; -using Wox.Core.i18n; +using Wox.Core.Resource; using Wox.Core.UserSettings; namespace Wox diff --git a/Wox/HotkeyControl.xaml.cs b/Wox/HotkeyControl.xaml.cs index ae38b9f90..fd7a1205e 100644 --- a/Wox/HotkeyControl.xaml.cs +++ b/Wox/HotkeyControl.xaml.cs @@ -5,7 +5,7 @@ using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; using NHotkey.Wpf; -using Wox.Core.i18n; +using Wox.Core.Resource; using Wox.Infrastructure.Hotkey; using Wox.Plugin; diff --git a/Wox/MainWindow.xaml.cs b/Wox/MainWindow.xaml.cs index 84e76e886..c0795c70e 100644 --- a/Wox/MainWindow.xaml.cs +++ b/Wox/MainWindow.xaml.cs @@ -15,9 +15,8 @@ using System.Windows.Input; using System.Windows.Media.Animation; using NHotkey; using NHotkey.Wpf; -using Wox.Core.i18n; using Wox.Core.Plugin; -using Wox.Core.Theme; +using Wox.Core.Resource; using Wox.Core.Updater; using Wox.Core.UserSettings; using Wox.Helper; diff --git a/Wox/SettingWindow.xaml.cs b/Wox/SettingWindow.xaml.cs index 28a481d6d..effdddb61 100644 --- a/Wox/SettingWindow.xaml.cs +++ b/Wox/SettingWindow.xaml.cs @@ -11,9 +11,8 @@ using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using Microsoft.Win32; -using Wox.Core.i18n; using Wox.Core.Plugin; -using Wox.Core.Theme; +using Wox.Core.Resource; using Wox.Core.Updater; using Wox.Core.UserSettings; using Wox.Helper; diff --git a/Wox/WoxUpdate.xaml.cs b/Wox/WoxUpdate.xaml.cs index 3534bac0b..83f7e57d5 100644 --- a/Wox/WoxUpdate.xaml.cs +++ b/Wox/WoxUpdate.xaml.cs @@ -1,6 +1,6 @@ using System.Windows; using MarkdownSharp; -using Wox.Core.i18n; +using Wox.Core.Resource; using Wox.Core.Updater; namespace Wox