public async Task LoadSettingsFileLocal() { // if successful set and invalidate // If not loadSettings again var SETTINGS_FILE_NAME = string.IsNullOrEmpty(LocalSettingsLocation) ? GlobalConfig.DEFAULT_SETTINGS_FILE_NAME : LocalSettingsLocation; try { await Task.Factory.StartNew(() => { if (fileHelper.FileExists(SETTINGS_FILE_NAME)) { using (var stream = fileHelper.FileOpenRead("", SETTINGS_FILE_NAME)) { try { if (stream != null) { _settings = _settings.Deserialise(stream); } } catch { } } } }); } catch { throw new FileNotFoundException("Could not locate the local Settings file"); } }
public async Task LoadSettingsFileLocal() { // if successful set and invalidate // If not loadSettings again var SETTINGS_FILE_NAME = string.IsNullOrEmpty(LocalSettingsLocation) ? GlobalConfig.DEFAULT_SETTINGS_FILE_NAME : LocalSettingsLocation; try { var stream = await fileHelper.OpenStreamAsync(SETTINGS_FILE_NAME); if (stream != null) { _settings = _settings.Deserialise(stream); } } catch { throw new FileNotFoundException("Could not locate the local Settings file"); } }