Exemple #1
0
        public VpnMonitor(Vpn vpn, IVpnMonitorDriver vpnMonitorDriver)
        {
            Vpn = vpn ?? throw new ArgumentNullException(nameof(vpn));
            _vpnMonitorDriver = vpnMonitorDriver ?? throw new ArgumentNullException(nameof(vpnMonitorDriver));

            _refreshTimer = new Timer(async _ => await Refresh());
        }
Exemple #2
0
 public VpnManager(Vpn vpn, IVpnConnectorDriver vpnConnectorDriver, IVpnMonitorDriver vpnMonitorDriver, ISystemEventsProvider systemEventsProvider)
 {
     Vpn = vpn;
     _systemEventsProvider = systemEventsProvider;
     Connector             = new VpnConnector(vpn, vpnConnectorDriver);
     Monitor = new VpnMonitor(vpn, vpnMonitorDriver);
     _systemEventsProvider.SessionLock   += new EventHandler(async(s, e) => await _systemEventsProvider_SessionLock(s, e));
     _systemEventsProvider.SessionUnlock += new EventHandler(async(s, e) => await _systemEventsProvider_SessionUnlock(s, e));
 }
Exemple #3
0
 public VpnConnector(Vpn vpn, IVpnConnectorDriver vpnConnectorDriver)
 {
     _vpnConnectorDriver = vpnConnectorDriver ?? throw new ArgumentNullException(nameof(vpnConnectorDriver));
     Vpn = vpn ?? throw new ArgumentNullException(nameof(vpn));
 }
Exemple #4
0
 public VpnEventArgs(Vpn vpn)
 {
     Vpn = vpn;
 }
Exemple #5
0
 public VpnManager Create(Vpn vpn)
 {
     return(new VpnManager(vpn, _vpnConnectorDriver, _vpnMonitorDriver, _systemEventsProvider));
 }