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()); }
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)); }
public VpnConnector(Vpn vpn, IVpnConnectorDriver vpnConnectorDriver) { _vpnConnectorDriver = vpnConnectorDriver ?? throw new ArgumentNullException(nameof(vpnConnectorDriver)); Vpn = vpn ?? throw new ArgumentNullException(nameof(vpn)); }
public VpnEventArgs(Vpn vpn) { Vpn = vpn; }
public VpnManager Create(Vpn vpn) { return(new VpnManager(vpn, _vpnConnectorDriver, _vpnMonitorDriver, _systemEventsProvider)); }