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; }
public async Task <CachedProfileData> LockedProfileData() { return(new CachedProfileData(_appSettings, await _accessQueue.Lock())); }