From da5a930e89d0e0ec94655ea195dbe00c748e0091 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Mon, 9 Nov 2015 01:32:33 +0000 Subject: [PATCH] Move namespace --- .../ProgramSources/FileSystemProgramSource.cs | 2 +- Wox.Core/Plugin/CSharpPluginLoader.cs | 2 +- Wox.Core/Plugin/JsonRPCPlugin.cs | 2 +- Wox.Core/Plugin/PluginConfig.cs | 2 +- Wox.Core/Plugin/PluginManager.cs | 4 ++-- Wox.Core/Updater/SemanticVersion.cs | 2 +- Wox.Core/i18n/Internationalization.cs | 2 +- Wox.Infrastructure/Exception/ExceptionFormatter.cs | 2 +- Wox.Infrastructure/Exception/WoxException.cs | 2 +- Wox.Infrastructure/Exception/WoxFatalException.cs | 2 +- Wox.Infrastructure/Exception/WoxHttpException.cs | 2 +- Wox.Infrastructure/Exception/WoxI18nException.cs | 4 ++-- Wox.Infrastructure/Exception/WoxJsonRPCException.cs | 2 +- Wox.Infrastructure/Exception/WoxPluginException.cs | 2 +- Wox.Infrastructure/Http/HttpRequest.cs | 7 +++---- Wox.Infrastructure/Logger/Log.cs | 8 +++----- Wox.Infrastructure/Storage/BinaryStorage.cs | 6 +++--- Wox.Infrastructure/Storage/JsonStorage.cs | 2 +- Wox.Infrastructure/WindowsShellRun.cs | 4 ++-- Wox.Test/Plugins/PluginInitTest.cs | 2 +- Wox/Helper/ErrorReporting.cs | 2 +- 21 files changed, 30 insertions(+), 33 deletions(-) diff --git a/Plugins/Wox.Plugin.Program/ProgramSources/FileSystemProgramSource.cs b/Plugins/Wox.Plugin.Program/ProgramSources/FileSystemProgramSource.cs index f5571a18df..b266cc654f 100644 --- a/Plugins/Wox.Plugin.Program/ProgramSources/FileSystemProgramSource.cs +++ b/Plugins/Wox.Plugin.Program/ProgramSources/FileSystemProgramSource.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using Wox.Core.Exception; +using Wox.Infrastructure.Exception; using Wox.Infrastructure.Logger; namespace Wox.Plugin.Program.ProgramSources diff --git a/Wox.Core/Plugin/CSharpPluginLoader.cs b/Wox.Core/Plugin/CSharpPluginLoader.cs index c5d1c78edc..5eb4a830e0 100644 --- a/Wox.Core/Plugin/CSharpPluginLoader.cs +++ b/Wox.Core/Plugin/CSharpPluginLoader.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; -using Wox.Core.Exception; +using Wox.Infrastructure.Exception; using Wox.Infrastructure.Logger; using Wox.Plugin; diff --git a/Wox.Core/Plugin/JsonRPCPlugin.cs b/Wox.Core/Plugin/JsonRPCPlugin.cs index a7d5db8cc5..5c08f9a8a2 100644 --- a/Wox.Core/Plugin/JsonRPCPlugin.cs +++ b/Wox.Core/Plugin/JsonRPCPlugin.cs @@ -5,7 +5,7 @@ using System.Reflection; using System.Threading; using System.Windows.Forms; using Newtonsoft.Json; -using Wox.Core.Exception; +using Wox.Infrastructure.Exception; using Wox.Infrastructure.Logger; using Wox.Plugin; diff --git a/Wox.Core/Plugin/PluginConfig.cs b/Wox.Core/Plugin/PluginConfig.cs index 05f72bbe64..30bacef838 100644 --- a/Wox.Core/Plugin/PluginConfig.cs +++ b/Wox.Core/Plugin/PluginConfig.cs @@ -2,8 +2,8 @@ using System.IO; using System.Linq; using Newtonsoft.Json; -using Wox.Core.Exception; using Wox.Core.UserSettings; +using Wox.Infrastructure.Exception; using Wox.Infrastructure.Logger; using Wox.Plugin; diff --git a/Wox.Core/Plugin/PluginManager.cs b/Wox.Core/Plugin/PluginManager.cs index 06f10f7278..f04c5a045f 100644 --- a/Wox.Core/Plugin/PluginManager.cs +++ b/Wox.Core/Plugin/PluginManager.cs @@ -4,10 +4,10 @@ using System.IO; using System.Linq; using System.Reflection; using System.Threading; -using Wox.Core.Exception; using Wox.Core.i18n; using Wox.Core.UI; using Wox.Core.UserSettings; +using Wox.Infrastructure.Exception; using Wox.Infrastructure.Logger; using Wox.Plugin; using Stopwatch = Wox.Infrastructure.Stopwatch; @@ -30,7 +30,7 @@ namespace Wox.Core.Plugin public static IEnumerable AllPlugins { get; private set; } public static List GlobalPlugins { get; } = new List(); - public static Dictionary NonGlobalPlugins { get; } = new Dictionary(); + public static Dictionary NonGlobalPlugins { get; set; } = new Dictionary(); private static IEnumerable InstantQueryPlugins { get; set; } public static IPublicAPI API { private set; get; } diff --git a/Wox.Core/Updater/SemanticVersion.cs b/Wox.Core/Updater/SemanticVersion.cs index 693ce73eef..ed3ef7b317 100644 --- a/Wox.Core/Updater/SemanticVersion.cs +++ b/Wox.Core/Updater/SemanticVersion.cs @@ -1,5 +1,5 @@ using System; -using Wox.Core.Exception; +using Wox.Infrastructure.Exception; namespace Wox.Core.Updater { diff --git a/Wox.Core/i18n/Internationalization.cs b/Wox.Core/i18n/Internationalization.cs index d94044a821..0cfea890a3 100644 --- a/Wox.Core/i18n/Internationalization.cs +++ b/Wox.Core/i18n/Internationalization.cs @@ -4,9 +4,9 @@ using System.IO; using System.Linq; using System.Reflection; using System.Windows; -using Wox.Core.Exception; using Wox.Core.UI; using Wox.Core.UserSettings; +using Wox.Infrastructure.Exception; using Wox.Infrastructure.Logger; using Wox.Plugin; diff --git a/Wox.Infrastructure/Exception/ExceptionFormatter.cs b/Wox.Infrastructure/Exception/ExceptionFormatter.cs index d4e8beb8a8..ce232d07d8 100644 --- a/Wox.Infrastructure/Exception/ExceptionFormatter.cs +++ b/Wox.Infrastructure/Exception/ExceptionFormatter.cs @@ -5,7 +5,7 @@ using System.Text; using System.Xml; using Microsoft.Win32; -namespace Wox.Core.Exception +namespace Wox.Infrastructure.Exception { public class ExceptionFormatter { diff --git a/Wox.Infrastructure/Exception/WoxException.cs b/Wox.Infrastructure/Exception/WoxException.cs index bd23429ab6..89a61119af 100644 --- a/Wox.Infrastructure/Exception/WoxException.cs +++ b/Wox.Infrastructure/Exception/WoxException.cs @@ -1,4 +1,4 @@ -namespace Wox.Core.Exception +namespace Wox.Infrastructure.Exception { /// /// Base Wox Exceptions diff --git a/Wox.Infrastructure/Exception/WoxFatalException.cs b/Wox.Infrastructure/Exception/WoxFatalException.cs index 21984f18d4..6a1da4a62b 100644 --- a/Wox.Infrastructure/Exception/WoxFatalException.cs +++ b/Wox.Infrastructure/Exception/WoxFatalException.cs @@ -1,4 +1,4 @@ -namespace Wox.Core.Exception +namespace Wox.Infrastructure.Exception { /// /// Represent exceptions that wox can't handle and MUST close running Wox. diff --git a/Wox.Infrastructure/Exception/WoxHttpException.cs b/Wox.Infrastructure/Exception/WoxHttpException.cs index 55e3431a0e..2626a3dc76 100644 --- a/Wox.Infrastructure/Exception/WoxHttpException.cs +++ b/Wox.Infrastructure/Exception/WoxHttpException.cs @@ -1,4 +1,4 @@ -namespace Wox.Core.Exception +namespace Wox.Infrastructure.Exception { public class WoxHttpException :WoxException { diff --git a/Wox.Infrastructure/Exception/WoxI18nException.cs b/Wox.Infrastructure/Exception/WoxI18nException.cs index 72b62df988..c06ad78022 100644 --- a/Wox.Infrastructure/Exception/WoxI18nException.cs +++ b/Wox.Infrastructure/Exception/WoxI18nException.cs @@ -1,6 +1,6 @@ -namespace Wox.Core.Exception +namespace Wox.Infrastructure.Exception { - public class WoxI18nException:WoxException + public class WoxI18nException : WoxException { public WoxI18nException(string msg) : base(msg) { diff --git a/Wox.Infrastructure/Exception/WoxJsonRPCException.cs b/Wox.Infrastructure/Exception/WoxJsonRPCException.cs index d3c0bfb0da..88bb3f5ed5 100644 --- a/Wox.Infrastructure/Exception/WoxJsonRPCException.cs +++ b/Wox.Infrastructure/Exception/WoxJsonRPCException.cs @@ -1,4 +1,4 @@ -namespace Wox.Core.Exception +namespace Wox.Infrastructure.Exception { public class WoxJsonRPCException : WoxException { diff --git a/Wox.Infrastructure/Exception/WoxPluginException.cs b/Wox.Infrastructure/Exception/WoxPluginException.cs index bc1854f564..7aea174fd3 100644 --- a/Wox.Infrastructure/Exception/WoxPluginException.cs +++ b/Wox.Infrastructure/Exception/WoxPluginException.cs @@ -1,4 +1,4 @@ -namespace Wox.Core.Exception +namespace Wox.Infrastructure.Exception { public class WoxPluginException : WoxException { diff --git a/Wox.Infrastructure/Http/HttpRequest.cs b/Wox.Infrastructure/Http/HttpRequest.cs index c979cca6d1..628d747887 100644 --- a/Wox.Infrastructure/Http/HttpRequest.cs +++ b/Wox.Infrastructure/Http/HttpRequest.cs @@ -1,5 +1,4 @@ -using System; -using System.IO; +using System.IO; using System.Net; using System.Text; using Wox.Plugin; @@ -55,7 +54,7 @@ namespace Wox.Infrastructure.Http } } } - catch (Exception e) + catch (System.Exception e) { Logger.Log.Error(e); return string.Empty; @@ -108,7 +107,7 @@ namespace Wox.Infrastructure.Http } } } - catch (Exception e) + catch (System.Exception e) { Logger.Log.Error(e); return string.Empty; diff --git a/Wox.Infrastructure/Logger/Log.cs b/Wox.Infrastructure/Logger/Log.cs index e03c7045bc..5573450986 100644 --- a/Wox.Infrastructure/Logger/Log.cs +++ b/Wox.Infrastructure/Logger/Log.cs @@ -1,6 +1,4 @@ -using System; -using NLog; -using Wox.Core.Exception; +using NLog; namespace Wox.Infrastructure.Logger { @@ -8,7 +6,7 @@ namespace Wox.Infrastructure.Logger { private static NLog.Logger logger = LogManager.GetCurrentClassLogger(); - public static void Error(Exception e) + public static void Error(System.Exception e) { #if DEBUG throw e; @@ -35,7 +33,7 @@ namespace Wox.Infrastructure.Logger logger.Warn(msg); } - public static void Fatal(Exception e) + public static void Fatal(System.Exception e) { #if DEBUG throw e; diff --git a/Wox.Infrastructure/Storage/BinaryStorage.cs b/Wox.Infrastructure/Storage/BinaryStorage.cs index fb49507ec0..de1c732f6e 100644 --- a/Wox.Infrastructure/Storage/BinaryStorage.cs +++ b/Wox.Infrastructure/Storage/BinaryStorage.cs @@ -42,7 +42,7 @@ namespace Wox.Infrastructure.Storage serializedObject = LoadDefault(); #if (DEBUG) { - throw new Exception("deserialize failed"); + throw new System.Exception("deserialize failed"); } #endif } @@ -53,7 +53,7 @@ namespace Wox.Infrastructure.Storage } } } - catch (Exception e) + catch (System.Exception e) { Log.Error(e); serializedObject = LoadDefault(); @@ -101,7 +101,7 @@ namespace Wox.Infrastructure.Storage binaryFormatter.Serialize(fileStream, serializedObject); fileStream.Close(); } - catch (Exception e) + catch (System.Exception e) { Log.Error(e); #if (DEBUG) diff --git a/Wox.Infrastructure/Storage/JsonStorage.cs b/Wox.Infrastructure/Storage/JsonStorage.cs index b01f7277b5..ceace60009 100644 --- a/Wox.Infrastructure/Storage/JsonStorage.cs +++ b/Wox.Infrastructure/Storage/JsonStorage.cs @@ -25,7 +25,7 @@ namespace Wox.Infrastructure.Storage { serializedObject = JsonConvert.DeserializeObject(json); } - catch (Exception) + catch (System.Exception) { serializedObject = LoadDefault(); } diff --git a/Wox.Infrastructure/WindowsShellRun.cs b/Wox.Infrastructure/WindowsShellRun.cs index 9a638a6cc5..549815f962 100644 --- a/Wox.Infrastructure/WindowsShellRun.cs +++ b/Wox.Infrastructure/WindowsShellRun.cs @@ -115,7 +115,7 @@ namespace Wox.Infrastructure needsCommandLine = peHeaderReader.OptionalHeader64.Subsystem == 3; } - catch (Exception) + catch (System.Exception) { // Error reading the headers. We will try to run the command the standard way. needsCommandLine = false; @@ -149,7 +149,7 @@ namespace Wox.Infrastructure { global::System.Diagnostics.Process.Start(startInfo); } - catch (Exception e) + catch (System.Exception e) { if (!startInfo.ErrorDialog) throw e; diff --git a/Wox.Test/Plugins/PluginInitTest.cs b/Wox.Test/Plugins/PluginInitTest.cs index e23fa54322..2afd891533 100644 --- a/Wox.Test/Plugins/PluginInitTest.cs +++ b/Wox.Test/Plugins/PluginInitTest.cs @@ -1,6 +1,6 @@ using NUnit.Framework; -using Wox.Core.Exception; using Wox.Core.Plugin; +using Wox.Infrastructure.Exception; namespace Wox.Test.Plugins { diff --git a/Wox/Helper/ErrorReporting.cs b/Wox/Helper/ErrorReporting.cs index 63c6f80dc8..b13ed405bc 100644 --- a/Wox/Helper/ErrorReporting.cs +++ b/Wox/Helper/ErrorReporting.cs @@ -1,6 +1,6 @@ using System; using System.Windows.Threading; -using Wox.Core.Exception; +using Wox.Infrastructure.Exception; using Wox.Infrastructure.Logger; namespace Wox.Helper