mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Moved ApplicationInstanceManager outside folder
This commit is contained in:
parent
5ef6e100f2
commit
ef6eb94e28
4 changed files with 25 additions and 58 deletions
|
@ -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; }
|
||||
}
|
||||
}
|
|
@ -352,8 +352,7 @@
|
|||
</Compile>
|
||||
<Compile Include="Printer\PrintTextHelper.cs" />
|
||||
<Compile Include="Helpers\RegistryHelpers.cs" />
|
||||
<Compile Include="SingleInstanceApplication\ApplicationInstanceManager.cs" />
|
||||
<Compile Include="SingleInstanceApplication\InstanceProxy.cs" />
|
||||
<Compile Include="ApplicationInstanceManager.cs" />
|
||||
<Compile Include="DebugHelper.cs" />
|
||||
<Compile Include="UpdateChecker\UpdateCheckerLabel.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
|
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#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; }
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue