private async void UpdateSpeed(object sender, EventArgs e) { InOutBytes total; using (await _lock.Lock()) { try { total = await _vpnServiceManager.Total(); } catch (CommunicationException) { return; } catch (TimeoutException) { return; } } _speed = total - _total; _total = total; }
private static InOutBytesContract Map(InOutBytes bytes) { return(new InOutBytesContract(bytes.BytesIn, bytes.BytesOut)); }
private void OnTransportStatsChanged(InOutBytes bandwidth) { TransportStatsChanged?.Invoke(this, new EventArgs <InOutBytes>(bandwidth)); }
private void ManagementClient_TransportStatsChanged(object sender, EventArgs <InOutBytes> e) { Total = e.Data; }
private void HandleByteMessage(ReceivedManagementMessage message) { InOutBytes bandwidth = message.Bandwidth(); OnTransportStatsChanged(bandwidth); }
private void OnTrafficSent(object sender, InOutBytes total) { Total = total; }