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

Commit 46937af

Browse files
committed
rm wait
1 parent 49acd35 commit 46937af

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,36 @@ public MainWindow()
2323

2424
Application.Current.Exit += OnApplicationExit;
2525

26-
var keyboardWatcher = eventHookFactory.GetKeyboardWatcher();
26+
keyboardWatcher = eventHookFactory.GetKeyboardWatcher();
2727
keyboardWatcher.Start();
2828
keyboardWatcher.OnKeyInput += (s, e) =>
2929
{
3030
Console.WriteLine(string.Format("Key {0} event of key {1}", e.KeyData.EventType, e.KeyData.Keyname));
3131
};
3232

33-
var mouseWatcher = eventHookFactory.GetMouseWatcher();
33+
mouseWatcher = eventHookFactory.GetMouseWatcher();
3434
mouseWatcher.Start();
3535
mouseWatcher.OnMouseInput += (s, e) =>
3636
{
3737
Console.WriteLine(string.Format("Mouse event {0} at point {1},{2}", e.Message.ToString(), e.Point.x, e.Point.y));
3838
};
3939

40-
var clipboardWatcher = eventHookFactory.GetClipboardWatcher();
40+
clipboardWatcher = eventHookFactory.GetClipboardWatcher();
4141
clipboardWatcher.Start();
4242
clipboardWatcher.OnClipboardModified += (s, e) =>
4343
{
4444
Console.WriteLine(string.Format("Clipboard updated with data '{0}' of format {1}", e.Data, e.DataFormat.ToString()));
4545
};
4646

4747

48-
var applicationWatcher = eventHookFactory.GetApplicationWatcher();
48+
applicationWatcher = eventHookFactory.GetApplicationWatcher();
4949
applicationWatcher.Start();
5050
applicationWatcher.OnApplicationWindowChange += (s, e) =>
5151
{
5252
Console.WriteLine(string.Format("Application window of '{0}' with the title '{1}' was {2}", e.ApplicationData.AppName, e.ApplicationData.AppTitle, e.Event));
5353
};
5454

55-
var printWatcher = eventHookFactory.GetPrintWatcher();
55+
printWatcher = eventHookFactory.GetPrintWatcher();
5656
printWatcher.Start();
5757
printWatcher.OnPrintEvent += (s, e) =>
5858
{

EventHook.Examples/EventHook.WinForms.Example/MainForm.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,36 @@ public MainForm()
2727

2828
InitializeComponent();
2929

30-
var keyboardWatcher = eventHookFactory.GetKeyboardWatcher();
30+
keyboardWatcher = eventHookFactory.GetKeyboardWatcher();
3131
keyboardWatcher.Start();
3232
keyboardWatcher.OnKeyInput += (s, e) =>
3333
{
3434
Console.WriteLine(string.Format("Key {0} event of key {1}", e.KeyData.EventType, e.KeyData.Keyname));
3535
};
3636

37-
var mouseWatcher = eventHookFactory.GetMouseWatcher();
37+
mouseWatcher = eventHookFactory.GetMouseWatcher();
3838
mouseWatcher.Start();
3939
mouseWatcher.OnMouseInput += (s, e) =>
4040
{
4141
Console.WriteLine(string.Format("Mouse event {0} at point {1},{2}", e.Message.ToString(), e.Point.x, e.Point.y));
4242
};
4343

44-
var clipboardWatcher = eventHookFactory.GetClipboardWatcher();
44+
clipboardWatcher = eventHookFactory.GetClipboardWatcher();
4545
clipboardWatcher.Start();
4646
clipboardWatcher.OnClipboardModified += (s, e) =>
4747
{
4848
Console.WriteLine(string.Format("Clipboard updated with data '{0}' of format {1}", e.Data, e.DataFormat.ToString()));
4949
};
5050

5151

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

59-
var printWatcher = eventHookFactory.GetPrintWatcher();
59+
printWatcher = eventHookFactory.GetPrintWatcher();
6060
printWatcher.Start();
6161
printWatcher.OnPrintEvent += (s, e) =>
6262
{

EventHook/ApplicationWatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public void Stop()
122122
},
123123
CancellationToken.None,
124124
TaskCreationOptions.None,
125-
factory.GetTaskScheduler()).Wait();
125+
factory.GetTaskScheduler());
126126

127127
appQueue.Enqueue(false);
128128
isRunning = false;

EventHook/ClipboardWatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void Stop()
104104
},
105105
CancellationToken.None,
106106
TaskCreationOptions.None,
107-
factory.GetTaskScheduler()).Wait();
107+
factory.GetTaskScheduler());
108108
}
109109

110110
isRunning = false;

EventHook/KeyboardWatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void Stop()
107107
},
108108
CancellationToken.None,
109109
TaskCreationOptions.None,
110-
factory.GetTaskScheduler()).Wait();
110+
factory.GetTaskScheduler());
111111
}
112112

113113
keyQueue.Enqueue(false);

EventHook/MouseWatcher.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ public void Stop()
8484
mouseHook.Stop();
8585
mouseHook = null;
8686
},
87-
CancellationToken.None,
88-
TaskCreationOptions.None,
89-
factory.GetTaskScheduler()).Wait();
87+
CancellationToken.None,
88+
TaskCreationOptions.None,
89+
factory.GetTaskScheduler());
9090
}
9191

9292
mouseQueue.Enqueue(false);

EventHook/PrintWatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public void Stop()
114114
},
115115
CancellationToken.None,
116116
TaskCreationOptions.None,
117-
factory.GetTaskScheduler()).Wait();
117+
factory.GetTaskScheduler());
118118
}
119119
}
120120
}

0 commit comments

Comments
 (0)