public P2PModalViewModel(EventFacade eventFacade, IBrowser browser, BestUserServerProvider serverProvider, BestVpnServerConnector vpnConnector) { this._eventFacade = eventFacade; this._serverProvider = serverProvider; this._browser = browser; this._vpnConnector = vpnConnector; this._serverProvider.add_ServersChanged(new EventHandler(this.OnServersChanged)); this.set_DisplayName("Slow connection?"); }
public ServerSidePanelViewModel(VpnConnector vpnConnector, BestUserServerProvider bestServerProvider, VpnConnectionSpeedTracker speedTracker, UserPreferences userPreferences, IUserContext userContext, EventFacade eventFacade) { this._vpnConnector = vpnConnector; this._bestServerProvider = bestServerProvider; this._userPreferences = userPreferences; this._userContext = userContext; this._eventFacade = eventFacade; this._bestServerProvider.add_ServersChanged(new EventHandler(this.OnServersChanged)); this._vpnConnector.GeoServerConnectionStatusChanged += new ConnectionEventHandler <GeographicalServer>(this.OnServerConnectionStatusChanged); this._userPreferences.add_DistanceUnitsChanged(new EventHandler <DistanceUnitsChangedEventArgs>(this.OnDistanceUnitsChanged)); this._userContext.add_UserChanged(new EventHandler <UserEventArgs>(this.OnUserChanged)); this._userContext.add_FavouritesChanged(new EventHandler <FavouriteServersChangedEventArgs>(this.OnFavouritesChanged)); speedTracker.SpeedChanged = (EventHandler <VpnConnectionSpeedChangeEventArgs>)Delegate.Combine(speedTracker.SpeedChanged, new EventHandler <VpnConnectionSpeedChangeEventArgs>(this.OnVpnSpeedChanged)); }
public ServerSidePanelViewModel(VpnConnector vpnConnector, BestUserServerProvider bestServerProvider, ApiServerProvider apiServerProvider, VpnConnectionSpeedTracker speedTracker, ISettings userSettings, FavouritesManager favouritesManager, UserContext userContext, EventFacade eventFacade) { this._vpnConnector = vpnConnector; this._bestServerProvider = bestServerProvider; this._apiServerProvider = apiServerProvider; this._settings = userSettings; this._favouritesManager = favouritesManager; this._userContext = userContext; this._eventFacade = eventFacade; this._bestServerProvider.ServersChanged += new EventHandler(this.OnServersChanged); this._vpnConnector.GeoServerConnectionStatusChanged += new ConnectionEventHandler <GeographicalServer>(this.OnServerConnectionStatusChanged); this._userContext.add_UserChanged(delegate(object s, UserEventArgs e) { this.UpdateCurrentServerViewModel(); }); this._favouritesManager.FavouriteServersChanged += new EventHandler <FavouriteServersChangedEventArgs>(this.ChangeCurrentServerFavouriteStatus); speedTracker.SpeedChanged = (EventHandler <VpnConnectionSpeedChangeEventArgs>)Delegate.Combine(speedTracker.SpeedChanged, new EventHandler <VpnConnectionSpeedChangeEventArgs>(this.UpdateSpeeds)); this._settings.Observe <UserSettings, DistanceUnits>((UserSettings s) => s.DistanceUnits, delegate(DistanceUnits d) { this.UpdateCurrentServerViewModel(); }); }
public BestVpnServerConnector(IVpnConnectionManager connectionManager, BestUserServerProvider userServerRegistry) : base(connectionManager) { this._userServerRegistry = userServerRegistry; }