mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
ReSharper: remove redundant code
This commit is contained in:
@@ -25,7 +25,7 @@ namespace Wox.Helper
|
||||
{
|
||||
if (!DropShadow(window))
|
||||
{
|
||||
window.SourceInitialized += new EventHandler(window_SourceInitialized);
|
||||
window.SourceInitialized += window_SourceInitialized;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Wox.Helper
|
||||
|
||||
DropShadow(window);
|
||||
|
||||
window.SourceInitialized -= new EventHandler(window_SourceInitialized);
|
||||
window.SourceInitialized -= window_SourceInitialized;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,14 +16,14 @@ namespace Wox.Helper
|
||||
public static void UnhandledExceptionHandle(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
//handle non-ui thread exceptions
|
||||
App.Window.Dispatcher.Invoke(new Action(() =>
|
||||
App.Window.Dispatcher.Invoke(() =>
|
||||
{
|
||||
Report((Exception)e.ExceptionObject);
|
||||
if (!(e.ExceptionObject is WoxException))
|
||||
{
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
public static void DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Runtime.Remoting.Channels;
|
||||
using System.Runtime.Remoting.Channels.Ipc;
|
||||
using System.Runtime.Serialization.Formatters;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
@@ -131,7 +132,7 @@ namespace Wox.Helper
|
||||
// This is the hard-coded message value used by WinForms for Shell_NotifyIcon.
|
||||
// It's relatively safe to reuse.
|
||||
TRAYMOUSEMESSAGE = 0x800, //WM_USER + 1024
|
||||
APP = 0x8000,
|
||||
APP = 0x8000
|
||||
}
|
||||
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
@@ -342,7 +343,7 @@ namespace Wox.Helper
|
||||
{
|
||||
try
|
||||
{
|
||||
using (TextReader reader = new StreamReader(cmdLinePath, System.Text.Encoding.Unicode))
|
||||
using (TextReader reader = new StreamReader(cmdLinePath, Encoding.Unicode))
|
||||
{
|
||||
args = NativeMethods.CommandLineToArgvW(reader.ReadToEnd());
|
||||
}
|
||||
@@ -465,7 +466,7 @@ namespace Wox.Helper
|
||||
{
|
||||
// Do an asynchronous call to ActivateFirstInstance function
|
||||
Application.Current.Dispatcher.BeginInvoke(
|
||||
DispatcherPriority.Normal, new DispatcherOperationCallback(SingleInstance<TApplication>.ActivateFirstInstanceCallback), args);
|
||||
DispatcherPriority.Normal, new DispatcherOperationCallback(ActivateFirstInstanceCallback), args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Wox.Helper
|
||||
{
|
||||
try
|
||||
{
|
||||
var parts = result.ToString().Trim().Split(new char[] {' '}, 3).Select(byte.Parse).ToList();
|
||||
var parts = result.ToString().Trim().Split(new[] {' '}, 3).Select(byte.Parse).ToList();
|
||||
return Color.FromRgb(parts[0], parts[1], parts[2]);
|
||||
}
|
||||
catch
|
||||
|
||||
Reference in New Issue
Block a user