예제 #1
0
        private HoconValue GetNode(string path)
        {
            string[]   elements    = path.Split('.');
            HoconValue currentNode = _node;

            if (currentNode == null)
            {
                if (_fallback != null)
                {
                    return(_fallback.GetNode(path));
                }

                return(null);
            }
            foreach (string key in elements)
            {
                currentNode = currentNode.GetChildObject(key);
                if (currentNode == null)
                {
                    if (_fallback != null)
                    {
                        return(_fallback.GetNode(path));
                    }

                    return(null);
                }
            }
            return(currentNode);
        }
예제 #2
0
        private HoconValue GetNode(string path)
        {
            var        parsedPath  = path.SplitDottedPathHonouringQuotes();
            HoconValue currentNode = Root;

            if (currentNode == null)
            {
                throw new InvalidOperationException("Current node should not be null");
            }
            foreach (string key in parsedPath)
            {
                currentNode = currentNode.GetChildObject(key);
                if (currentNode == null)
                {
                    return(null);
                }
            }
            return(currentNode);
        }
예제 #3
0
파일: Config.cs 프로젝트: anthrax3/hocon
        private HoconValue GetNode(string path)
        {
            string[]   elements    = path.Split('.');
            HoconValue currentNode = Root;

            if (currentNode == null)
            {
                throw new InvalidOperationException("Current node should not be null");
            }
            foreach (string key in elements)
            {
                currentNode = currentNode.GetChildObject(key);
                if (currentNode == null)
                {
                    if (Fallback != null)
                    {
                        return(Fallback.GetNode(path));
                    }

                    return(null);
                }
            }
            return(currentNode);
        }