Skip to content
This repository was archived by the owner on Apr 21, 2021. It is now read-only.

Commit d9f655e

Browse files
committed
cleanup
1 parent dea813f commit d9f655e

39 files changed

+694
-608
lines changed

.nuget/NuGet.Config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
23
<configuration>
34
<solution>
45
<add key="disableSourceControlIntegration" value="true" />

EventHook.Examples/EventHook.ConsoleApp.Example/Program.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,52 @@
22

33
namespace EventHook.ConsoleApp.Example
44
{
5-
class Program
5+
internal class Program
66
{
7-
8-
static void Main(string[] args)
7+
private static void Main(string[] args)
98
{
109
var eventHookFactory = new EventHookFactory();
1110

1211
var keyboardWatcher = eventHookFactory.GetKeyboardWatcher();
1312
keyboardWatcher.Start();
1413
keyboardWatcher.OnKeyInput += (s, e) =>
1514
{
16-
Console.WriteLine(string.Format("Key {0} event of key {1}", e.KeyData.EventType, e.KeyData.Keyname));
15+
Console.WriteLine("Key {0} event of key {1}", e.KeyData.EventType, e.KeyData.Keyname);
1716
};
1817

1918
var mouseWatcher = eventHookFactory.GetMouseWatcher();
2019
mouseWatcher.Start();
2120
mouseWatcher.OnMouseInput += (s, e) =>
2221
{
23-
Console.WriteLine(string.Format("Mouse event {0} at point {1},{2}", e.Message.ToString(), e.Point.x, e.Point.y));
22+
Console.WriteLine("Mouse event {0} at point {1},{2}", e.Message.ToString(), e.Point.x, e.Point.y);
2423
};
2524

2625
var clipboardWatcher = eventHookFactory.GetClipboardWatcher();
2726
clipboardWatcher.Start();
2827
clipboardWatcher.OnClipboardModified += (s, e) =>
2928
{
30-
Console.WriteLine(string.Format("Clipboard updated with data '{0}' of format {1}", e.Data, e.DataFormat.ToString()));
29+
Console.WriteLine("Clipboard updated with data '{0}' of format {1}", e.Data,
30+
e.DataFormat.ToString());
3131
};
3232

3333

3434
var applicationWatcher = eventHookFactory.GetApplicationWatcher();
3535
applicationWatcher.Start();
3636
applicationWatcher.OnApplicationWindowChange += (s, e) =>
3737
{
38-
Console.WriteLine(string.Format("Application window of '{0}' with the title '{1}' was {2}", e.ApplicationData.AppName, e.ApplicationData.AppTitle, e.Event));
38+
Console.WriteLine("Application window of '{0}' with the title '{1}' was {2}",
39+
e.ApplicationData.AppName, e.ApplicationData.AppTitle, e.Event);
3940
};
4041

4142
var printWatcher = eventHookFactory.GetPrintWatcher();
4243
printWatcher.Start();
4344
printWatcher.OnPrintEvent += (s, e) =>
4445
{
45-
Console.WriteLine(string.Format("Printer '{0}' currently printing {1} pages.", e.EventData.PrinterName, e.EventData.Pages));
46+
Console.WriteLine("Printer '{0}' currently printing {1} pages.", e.EventData.PrinterName,
47+
e.EventData.Pages);
4648
};
4749

48-
50+
4951
Console.Read();
5052

5153
keyboardWatcher.Stop();
@@ -56,6 +58,5 @@ static void Main(string[] args)
5658

5759
eventHookFactory.Dispose();
5860
}
59-
6061
}
6162
}

EventHook.Examples/EventHook.ConsoleApp.Example/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// General Information about an assembly is controlled through the following
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
23
<configuration>
34
<runtime>
45
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
56
<dependentAssembly>
6-
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
7-
<bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0"/>
7+
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
8+
<bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0" />
89
</dependentAssembly>
910
<dependentAssembly>
10-
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
11-
<bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0"/>
11+
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
12+
<bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0" />
1213
</dependentAssembly>
1314
</assemblyBinding>
1415
</runtime>
15-
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
16+
<startup>
17+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
18+
</startup>
19+
</configuration>
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
23
<configuration>
3-
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
5-
</startup>
4+
<startup>
5+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
6+
</startup>
67
</configuration>

EventHook.Examples/EventHook.WPF.Example/App.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
StartupUri="MainWindow.xaml">
55
<Application.Resources>
6-
6+
77
</Application.Resources>
8-
</Application>
8+
</Application>

EventHook.Examples/EventHook.WPF.Example/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace EventHook.WPF.Example
44
{
55
/// <summary>
6-
/// Interaction logic for App.xaml
6+
/// Interaction logic for App.xaml
77
/// </summary>
88
public partial class App : Application
99
{

EventHook.Examples/EventHook.WPF.Example/MainWindow.xaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
Title="MainWindow" Height="350" Width="525">
5-
<Grid>
6-
7-
</Grid>
8-
</Window>
5+
<Grid />
6+
</Window>

EventHook.Examples/EventHook.WPF.Example/MainWindow.xaml.cs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
using System;
2-
using System.Diagnostics;
32
using System.Windows;
43

54
namespace EventHook.WPF.Example
65
{
76
/// <summary>
8-
/// Interaction logic for MainWindow.xaml
7+
/// Interaction logic for MainWindow.xaml
98
/// </summary>
109
public partial class MainWindow : Window
1110
{
12-
private EventHookFactory eventHookFactory = new EventHookFactory();
13-
14-
private ApplicationWatcher applicationWatcher;
15-
private KeyboardWatcher keyboardWatcher;
16-
private MouseWatcher mouseWatcher;
17-
private ClipboardWatcher clipboardWatcher;
18-
private PrintWatcher printWatcher;
11+
private readonly ApplicationWatcher applicationWatcher;
12+
private readonly ClipboardWatcher clipboardWatcher;
13+
private readonly EventHookFactory eventHookFactory = new EventHookFactory();
14+
private readonly KeyboardWatcher keyboardWatcher;
15+
private readonly MouseWatcher mouseWatcher;
16+
private readonly PrintWatcher printWatcher;
1917

2018
public MainWindow()
2119
{
@@ -27,36 +25,39 @@ public MainWindow()
2725
keyboardWatcher.Start();
2826
keyboardWatcher.OnKeyInput += (s, e) =>
2927
{
30-
Console.WriteLine(string.Format("Key {0} event of key {1}", e.KeyData.EventType, e.KeyData.Keyname));
28+
Console.WriteLine("Key {0} event of key {1}", e.KeyData.EventType, e.KeyData.Keyname);
3129
};
3230

3331
mouseWatcher = eventHookFactory.GetMouseWatcher();
3432
mouseWatcher.Start();
3533
mouseWatcher.OnMouseInput += (s, e) =>
3634
{
37-
Console.WriteLine(string.Format("Mouse event {0} at point {1},{2}", e.Message.ToString(), e.Point.x, e.Point.y));
35+
Console.WriteLine("Mouse event {0} at point {1},{2}", e.Message.ToString(), e.Point.x, e.Point.y);
3836
};
3937

4038
clipboardWatcher = eventHookFactory.GetClipboardWatcher();
4139
clipboardWatcher.Start();
4240
clipboardWatcher.OnClipboardModified += (s, e) =>
4341
{
44-
Console.WriteLine(string.Format("Clipboard updated with data '{0}' of format {1}", e.Data, e.DataFormat.ToString()));
42+
Console.WriteLine("Clipboard updated with data '{0}' of format {1}", e.Data,
43+
e.DataFormat.ToString());
4544
};
4645

4746

4847
applicationWatcher = eventHookFactory.GetApplicationWatcher();
4948
applicationWatcher.Start();
5049
applicationWatcher.OnApplicationWindowChange += (s, e) =>
5150
{
52-
Console.WriteLine(string.Format("Application window of '{0}' with the title '{1}' was {2}", e.ApplicationData.AppName, e.ApplicationData.AppTitle, e.Event));
51+
Console.WriteLine("Application window of '{0}' with the title '{1}' was {2}",
52+
e.ApplicationData.AppName, e.ApplicationData.AppTitle, e.Event);
5353
};
5454

5555
printWatcher = eventHookFactory.GetPrintWatcher();
5656
printWatcher.Start();
5757
printWatcher.OnPrintEvent += (s, e) =>
5858
{
59-
Console.WriteLine(string.Format("Printer '{0}' currently printing {1} pages.", e.EventData.PrinterName, e.EventData.Pages));
59+
Console.WriteLine("Printer '{0}' currently printing {1} pages.", e.EventData.PrinterName,
60+
e.EventData.Pages);
6061
};
6162
eventHookFactory.Dispose();
6263
}

EventHook.Examples/EventHook.WPF.Example/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using System.Reflection;
2-
using System.Resources;
3-
using System.Runtime.CompilerServices;
42
using System.Runtime.InteropServices;
53
using System.Windows;
64

0 commit comments

Comments
 (0)