private void LoadCachedData() { var path = CacheFilePath; _logger.Info("Loading data from {0}", path); try { lock (_dataFileLock) { var encrypted = _fileSystem.ReadAllText(path, Encoding.UTF8); var json = _encryption.DecryptString(encrypted); _data = _json.DeserializeFromString <ConnectData>(json); } } catch (IOException) { // File isn't there. no biggie } catch (Exception ex) { _logger.ErrorException("Error loading data", ex); } }
private void LoadCachedData() { var path = CacheFilePath; try { lock (_dataFileLock) { var encrypted = _fileSystem.ReadAllText(path, Encoding.UTF8); var json = _encryption.DecryptString(encrypted); _data = _json.DeserializeFromString<ConnectData>(json); } } catch (IOException) { // File isn't there. no biggie } catch (Exception ex) { _logger.ErrorException("Error loading data", ex); } }