Exemple #1
0
        private HoconValue?GetNode(string path)
        {
            var node = Root;

            if (node == null)
            {
                throw new InvalidOperationException("Current node should not be null");
            }

            var elements = path.Split('.');

            foreach (string element in elements)
            {
                node = node.GetChildObject(element);
                if (node == null)
                {
                    if (Fallback != null)
                    {
                        return(Fallback.GetNode(path));
                    }

                    return(null);
                }
            }
            return(node);
        }
Exemple #2
0
        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);
        }