public async Task InitializeAsync()
        {
            var configJson = await AppInfoService.GetConfigurationSettingsAsync();

            if (String.IsNullOrWhiteSpace(configJson))
            {
                await SetupServersAsync();
                await SaveConfigAsync();
            }

            _isInitialized = true;
        }
示例#2
0
        public static async Task <T> RetrieveConfig <T>() where T : SalesforceConfig
        {
            var configJson = await AppInfoService.GetConfigurationSettingsAsync();

            if (String.IsNullOrWhiteSpace(configJson))
            {
                return(null);
            }
            try
            {
                return(JsonConvert.DeserializeObject <T>(EncryptionService.Decrypt(configJson)));
            }
            catch (Exception)
            {
                // couldn't decrypt config...
                await AppInfoService.ClearConfigurationSettingsAsync();

                return(null);
            }
        }