mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Init
This commit is contained in:
@@ -223,6 +223,8 @@ public class AsusACPI
|
||||
return _connected;
|
||||
}
|
||||
|
||||
private static ManagementEventWatcher? watcher;
|
||||
|
||||
public AsusACPI()
|
||||
{
|
||||
try
|
||||
@@ -747,10 +749,14 @@ public class AsusACPI
|
||||
{
|
||||
try
|
||||
{
|
||||
ManagementEventWatcher watcher = new ManagementEventWatcher();
|
||||
watcher.EventArrived += new EventArrivedEventHandler(EventHandler);
|
||||
watcher.Scope = new ManagementScope("root\\wmi");
|
||||
watcher.Query = new WqlEventQuery("SELECT * FROM AsusAtkWmiEvent");
|
||||
if (watcher is null)
|
||||
{
|
||||
watcher = new ManagementEventWatcher();
|
||||
watcher.EventArrived += new EventArrivedEventHandler(EventHandler);
|
||||
watcher.Scope = new ManagementScope("root\\wmi");
|
||||
watcher.Query = new WqlEventQuery("SELECT * FROM AsusAtkWmiEvent");
|
||||
}
|
||||
|
||||
watcher.Start();
|
||||
}
|
||||
catch
|
||||
|
||||
Reference in New Issue
Block a user