예제 #1
0
        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"));
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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;
            }
        }