コード例 #1
0
        /// <summary>
        /// Get the value from our configuration or default if we don't have it
        /// </summary>
        /// <param name="Category">The category to get</param>
        /// <param name="Key">The key to get</param>
        /// <param name="Default">The default value</param>
        /// <returns>If found the value or the default value if not found</returns>
        public object GetValue(string Category, string Key, object Default)
        {
            if (!Configuration.ContainsKey(Category))
            {
                MDLog.CWarn(IsLoaded, LOG_CAT, $"Couldn't find category {Category}");
                return(Default);
            }

            if (!Configuration[Category].ContainsKey(Key))
            {
                MDLog.CWarn(IsLoaded, LOG_CAT, $"Couldn't find key {Key} in category {Category}");
                return(Default);
            }

            return(Configuration[Category][Key]);
        }