public void TestCurrentConfig() { ParseConfig config = ParseConfig.CurrentConfig; if (config.TryGetValue("testKey", out string result) == true) { Assert.AreEqual("testValue", result); } Assert.AreEqual("testValue", config.Get <string>("testKey")); }
public async Task <String> getParseConfigElement(string keyName) { try { config = await ParseConfig.GetAsync(); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.Message); config = ParseConfig.CurrentConfig; } String parseConfigText = null; bool searchResult = config.TryGetValue <String>(keyName, out parseConfigText); if (searchResult) { return(parseConfigText); } else { return(null); } }
public async Task<String> getParseConfigElement(string keyName) { try { config = await ParseConfig.GetAsync(); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.Message); config = ParseConfig.CurrentConfig; } String parseConfigText = null; bool searchResult = config.TryGetValue<String>(keyName, out parseConfigText); if (searchResult) { return parseConfigText; } else { return null; } }