diff options
Diffstat (limited to 'MediaBrowser.Common/UI/SingleInstance.cs')
| -rw-r--r-- | MediaBrowser.Common/UI/SingleInstance.cs | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/MediaBrowser.Common/UI/SingleInstance.cs b/MediaBrowser.Common/UI/SingleInstance.cs index 837d3bb57..3fc85a74e 100644 --- a/MediaBrowser.Common/UI/SingleInstance.cs +++ b/MediaBrowser.Common/UI/SingleInstance.cs @@ -13,18 +13,17 @@ namespace Microsoft.Shell using System;
using System.Collections;
using System.Collections.Generic;
+ using System.ComponentModel;
using System.IO;
+ using System.Runtime.InteropServices;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Ipc;
using System.Runtime.Serialization.Formatters;
+ using System.Security;
using System.Threading;
using System.Windows;
using System.Windows.Threading;
- using System.Xml.Serialization;
- using System.Security;
- using System.Runtime.InteropServices;
- using System.ComponentModel;
internal enum WM
{
@@ -184,7 +183,7 @@ namespace Microsoft.Shell finally
{
- IntPtr p = _LocalFree(argv);
+ _LocalFree(argv);
// Otherwise LocalFree failed.
// Assert.AreEqual(IntPtr.Zero, p);
}
@@ -369,7 +368,7 @@ namespace Microsoft.Shell /// <param name="channelName">Application's IPC channel name.</param>
private static void CreateRemoteService(string channelName)
{
- BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider();
+ var serverProvider = new BinaryServerFormatterSinkProvider { };
serverProvider.TypeFilterLevel = TypeFilterLevel.Full;
IDictionary props = new Dictionary<string, string>();
@@ -384,7 +383,7 @@ namespace Microsoft.Shell ChannelServices.RegisterChannel(channel, true);
// Expose the remote service with the REMOTE_SERVICE_NAME
- IPCRemoteService remoteService = new IPCRemoteService();
+ var remoteService = new IPCRemoteService();
RemotingServices.Marshal(remoteService, RemoteServiceName);
}
@@ -399,13 +398,13 @@ namespace Microsoft.Shell /// </param>
private static void SignalFirstInstance(string channelName, IList<string> args)
{
- IpcClientChannel secondInstanceChannel = new IpcClientChannel();
+ var secondInstanceChannel = new IpcClientChannel();
ChannelServices.RegisterChannel(secondInstanceChannel, true);
string remotingServiceUrl = IpcProtocol + channelName + "/" + RemoteServiceName;
// Obtain a reference to the remoting service exposed by the server i.e the first instance of the application
- IPCRemoteService firstInstanceRemoteServiceReference = (IPCRemoteService)RemotingServices.Connect(typeof(IPCRemoteService), remotingServiceUrl);
+ var firstInstanceRemoteServiceReference = (IPCRemoteService)RemotingServices.Connect(typeof(IPCRemoteService), remotingServiceUrl);
// Check that the remote service exists, in some cases the first instance may not yet have created one, in which case
// the second instance should just exit
@@ -425,7 +424,7 @@ namespace Microsoft.Shell private static object ActivateFirstInstanceCallback(object arg)
{
// Get command line args to be passed to first instance
- IList<string> args = arg as IList<string>;
+ var args = arg as IList<string>;
ActivateFirstInstance(args);
return null;
}
|
