-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainThread.cs
More file actions
44 lines (34 loc) · 823 Bytes
/
MainThread.cs
File metadata and controls
44 lines (34 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Windows.Forms;
using SyncUsb;
class MainThread {
public static void Main(string[] args){
MainThread main = new MainThread();
main.init();
}
public void init(){
Config config = initConfig();
initUsbListener(config);
initUi();
}
public Config initConfig(){
return new Config();
}
public void initUsbListener(Config config){
UsbListener listener = new UsbListener(config.getUsbHash(), test);
Thread thread = new Thread(new ThreadStart(listener.start));
thread.Start();
}
public void initUi(){
Application.EnableVisualStyles();
Application.Run(new MainForm());
}
public void printAllUsb(){
foreach(UsbStore usb in UsbStoreProvider.getAllUsbStore()){
Console.WriteLine("\t- " + usb.getHash());
}
}
public string test(){
return "test";
}
}