From ef6eb94e28c756129b1d4e08950cfc39de2e72d1 Mon Sep 17 00:00:00 2001 From: Jaex Date: Sun, 20 Mar 2016 12:27:47 +0200 Subject: [PATCH] Moved ApplicationInstanceManager outside folder --- .../ApplicationInstanceManager.cs | 27 ++++++++-- ShareX.HelpersLib/ShareX.HelpersLib.csproj | 3 +- .../InstanceProxy.cs | 52 ------------------- ShareX/Program.cs | 1 - 4 files changed, 25 insertions(+), 58 deletions(-) rename ShareX.HelpersLib/{SingleInstanceApplication => }/ApplicationInstanceManager.cs (90%) delete mode 100644 ShareX.HelpersLib/SingleInstanceApplication/InstanceProxy.cs diff --git a/ShareX.HelpersLib/SingleInstanceApplication/ApplicationInstanceManager.cs b/ShareX.HelpersLib/ApplicationInstanceManager.cs similarity index 90% rename from ShareX.HelpersLib/SingleInstanceApplication/ApplicationInstanceManager.cs rename to ShareX.HelpersLib/ApplicationInstanceManager.cs index ce0f56f7a..7954b2485 100644 --- a/ShareX.HelpersLib/SingleInstanceApplication/ApplicationInstanceManager.cs +++ b/ShareX.HelpersLib/ApplicationInstanceManager.cs @@ -23,15 +23,14 @@ You should have received a copy of the GNU General Public License #endregion License Information (GPL v3) -using ShareX.HelpersLib; using System; -using System.Diagnostics; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Ipc; +using System.Security.Permissions; using System.Threading; -namespace SingleInstanceApplication +namespace ShareX.HelpersLib { public class ApplicationInstanceManager : IDisposable { @@ -172,4 +171,26 @@ private void WaitOrTimerCallback(object state, bool timedOut) } } } + + [Serializable] + [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] + internal class InstanceProxy : MarshalByRefObject + { + public static string[] CommandLineArgs { get; internal set; } + + public void SetCommandLineArgs(string[] commandLineArgs) + { + CommandLineArgs = commandLineArgs; + } + } + + public class InstanceCallbackEventArgs : EventArgs + { + internal InstanceCallbackEventArgs(string[] commandLineArgs) + { + CommandLineArgs = commandLineArgs; + } + + public string[] CommandLineArgs { get; private set; } + } } \ No newline at end of file diff --git a/ShareX.HelpersLib/ShareX.HelpersLib.csproj b/ShareX.HelpersLib/ShareX.HelpersLib.csproj index 509bb189b..a755d40bd 100644 --- a/ShareX.HelpersLib/ShareX.HelpersLib.csproj +++ b/ShareX.HelpersLib/ShareX.HelpersLib.csproj @@ -352,8 +352,7 @@ - - + UserControl diff --git a/ShareX.HelpersLib/SingleInstanceApplication/InstanceProxy.cs b/ShareX.HelpersLib/SingleInstanceApplication/InstanceProxy.cs deleted file mode 100644 index 8967fa2de..000000000 --- a/ShareX.HelpersLib/SingleInstanceApplication/InstanceProxy.cs +++ /dev/null @@ -1,52 +0,0 @@ -#region License Information (GPL v3) - -/* - ShareX - A program that allows you to take screenshots and share any file type - Copyright (c) 2007-2016 ShareX Team - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Optionally you can also view the license at . -*/ - -#endregion License Information (GPL v3) - -using System; -using System.Security.Permissions; - -namespace SingleInstanceApplication -{ - [Serializable] - [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] - internal class InstanceProxy : MarshalByRefObject - { - public static string[] CommandLineArgs { get; internal set; } - - public void SetCommandLineArgs(string[] commandLineArgs) - { - CommandLineArgs = commandLineArgs; - } - } - - public class InstanceCallbackEventArgs : EventArgs - { - internal InstanceCallbackEventArgs(string[] commandLineArgs) - { - CommandLineArgs = commandLineArgs; - } - - public string[] CommandLineArgs { get; private set; } - } -} \ No newline at end of file diff --git a/ShareX/Program.cs b/ShareX/Program.cs index e174af391..baefbc6c4 100644 --- a/ShareX/Program.cs +++ b/ShareX/Program.cs @@ -26,7 +26,6 @@ You should have received a copy of the GNU General Public License using ShareX.HelpersLib; using ShareX.Properties; using ShareX.UploadersLib; -using SingleInstanceApplication; using System; using System.Diagnostics; using System.IO;