-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNetworkEventSink.cs
executable file
·33 lines (28 loc) · 1.12 KB
/
NetworkEventSink.cs
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
using NETWORKLIST;
using System;
namespace NetWatcher
{
internal class NetworkEventSink : INetworkEvents
{
public event EventHandler<NetworkEventArgs> Added;
public event EventHandler<NetworkEventConnectivityArgs> ConnectivityChanged;
public event EventHandler<NetworkEventArgs> Deleted;
public event EventHandler<NetworkEventPropertyArgs> PropertyChanged;
public void NetworkAdded(Guid networkId)
{
Added?.Invoke(this, new NetworkEventArgs(networkId));
}
public void NetworkConnectivityChanged(Guid networkId, NLM_CONNECTIVITY newConnectivity)
{
ConnectivityChanged?.Invoke(this, new NetworkEventConnectivityArgs(networkId, newConnectivity));
}
public void NetworkDeleted(Guid networkId)
{
Deleted?.Invoke(this, new NetworkEventArgs(networkId));
}
public void NetworkPropertyChanged(Guid networkId, NLM_NETWORK_PROPERTY_CHANGE flags)
{
PropertyChanged?.Invoke(this, new NetworkEventPropertyArgs(networkId, flags));
}
}
}